Friday 15 August 2014

Capturing the first match with regex (C#) -


This is my first experience, part of my limited experience with C # and regular expressions and I have trouble capturing the first event Coming in a special expression of a match I believe that in the following example, words need to be clarified which words I want to do.

  Mail Extractor = (New Reggae (@ ". * \ D (? & Lt; name & gt; *) \ D. *")). Match ("It is expected that 1Bob9error1 will take 1 as a name"); Console.WriteLine (extractor.Groups ["name"]);  

I would like this expression to print "Bob" instead of "Error".

I have a hunch with which to do something? In front of Milan group, but I'm not sure what operation would you do? An explanation with some help in performing this particular case would be amazing.

Thank you guys, you do not know how much this site helps to start program like me.

Your problem is greed that reggax grows. your. * It initially grabs all this "It is expected that 1 Bob will pick up" instead of trying this reggae:

  \ d (?  

No comments:

Post a Comment