regular expression match does not work

Posted by Carlos_Liu on Stack Overflow See other posts from Stack Overflow or by Carlos_Liu
Published on 2010-03-17T09:09:03Z Indexed on 2010/03/17 9:11 UTC
Read the original article Hit count: 134

Filed under:
|

I have a string ABCD:10,20,,40;1/1;1/2,1/3,1/4 I want to split the string into the following parts:

ABCD -- splited by : 10,20,,40 -- splited by ; 1/1 1/2,1/3,1/4

Why the following regular expression does not work for me ?

string txt = @"ABCD:10,20,,40;1/1;1/2,1/3,1/4";

Regex reg = new Regex(@"\b(?<test>\w+):(?<com>\w+);(?<p1>\w+);(?<p2>\w+)");
Match match = reg.Match(txt);

© Stack Overflow or respective owner

Related posts about c#

Related posts about regex