kojoma kojoma - 1 year ago 95
C# Question

Find each RegEx match in string

id like to do something like

foreach (Match match in regex)

Thanks for any help...!

Answer Source

There is a RegEx.Matches method:

foreach (Match match in regex.Matches(myStringToMatch))

To get the matched substring, use the Match.Value property, as shown above.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download