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

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -