Problem with Regular Expression

Mar 23 2006 9:03 AM
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!