regex help

A

Aaron

i would like to search 3 different patterns with one regex
each line below represent one pattern.

+ spin.Go(
+ spin(
+ spin.Stop(

Thanks
Aaron
 
P

Paul E Collins

Aaron said:
i would like to search 3 different patterns with one regex
each line below represent one pattern.
+ spin.Go(
+ spin(
+ spin.Stop(

Use brackets and pipes to specify a group of alternatives.

Regex r = new Regex(@"\+ spin(|\.Go|\.Stop)\(");

P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Regex in C# 4
Newbie question about Regex 8
Regular Expression Pattern 7
RegEx Format Help 4
Regex issue 5
Verbatim String or Regex Pattern from Input 4
simple Regex does not match 2
Regex help needed 1

Top