-
Problem with Regex
I'm writing the following statement:
string sValue = @"(r11) , ";
string res = Regex.Match(sValue, @"[^,(\s)]+(\s)*,*(\s)*", RegexOptions.Compiled).Value;
Console.WriteLine(res););
I wish to get the string "(r11)" without the comma and the spaces.
Yet I get the string "r11" without the parentheses too.
What I'm doing wrong?
-
if you know that r11 is a fix then
you could try
string sValue = @"(r11) , (r11) ooioi0w0";
Regex r = new Regex(@"\(r11\)",RegexOptions.Compiled);
MessageBox.Show(r.Match(sValue).Value);
-Paresh
-
The idea is to remove the whitespaces and the comma after the expression.
(r11) is only an example
-
did you do your homework :-)
:D ;)
-
Got your message. Will try to come with less "homework" questions :)
-
u r becoming smarter day by day
hmm
;)