RegEx in C#, getting the values without criterias -
i terrible @ regex, in code below want actual numbers between sh:
, , or end of line.
how can achieve this?
[testmethod] public void sandbox() { var regex = new regex(@"sh\:(.*?)(\,|\z)"); var matches = regex.matches("some text|sh:0000000000,sh:1111111111"); foreach (var match in matches) { console.out.writeline(match); /* getting sh:0000000000, sh:1111111111 */ /* wanting 0000000000 1111111111 */ } }
just change loop below
foreach (match match in matches) { console.out.writeline(match.groups[1].value); }
Comments
Post a Comment