Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
Problem with Regular Expression
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Sebastian Banz
18y
2k
1
Reply
Hi,
I've got a Problem with dividing a string. Evertytime a "+" appears in the string, i want to split the string. That's not difficult:
RegEx rp =
new
Regex(@"\+");
string
[] parameters = rp.Split(input_string);
My problem ist, that if a "?" preceds "+", I don't want to divide the string. So I would write:
RegEx rp =
new
Regex(@"[^\?]\+");
The result is, that the programm removes the preceding character of ever simple "+".
Example:
Hello?+You --> Hello?+You
Hello+You --> Hell
You
^^the o is missing!!!
Is there a way to tell te Reqular Expression not to remove the preceding symbol?
Thanks for your help!
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
PDA Name
Timer in C# CF