Friday, 15 March 2013

c# - Regular expressions handling -



c# - Regular expressions handling -

i want write regular look can match next strings:

off on string valve

i thinking write ^(?<arrivingstring>[a-za-z]{?})$.

now don't know write within curly brackets, value of arriving string different , random.

thanks

^(?<arrivingstring>(off|on|string|valve)).*

this matches 4 words provided:

mutiline enabled regex the words @ start of each line

this regex match every line in it's entirety provided starts of 4 strings. captured grouping arrivingstringwill contain whichever of 4 words found.

c# regex expression

No comments:

Post a Comment