Home > DeveloperSection > Forums > How to write regular expression for "xyz xyx 15 16 b b a "?
Goti Bandu

Total Post:119

Points:835
Posted on    September-20-2014 2:36 AM

 C# .NET  C# 
Ratings:


 1 Reply(s)
 704  View(s)
Rate this:

How to redirect regular expression for “xyz xyx 15 16 b b a”?

In above

xyz xyx is fixed keyword

12 is first number that could be anything.

13 is also any number that may change

a b c may also change

I have only to check this string start with "abc xyz" and after that two integer value available. i am using c#.net for this coding.

It’s difficult please help me.



Anchal Kesharwani
Anchal Kesharwani

Total Post:10

Points:70
Posted on    September-20-2014 2:54 AM

hi Goti Bandhu,

I hope that this expression useful for you.

I am assuming that - space could be one or more - 15 is the first number that could be anything means fixed length of 2 digits - 16 is also number that may change means the same as above I guess - a b c also may change means character length is one with one or more space

 

/^xyz\s+xyx\s+\d{2}\s+\d{2}\s+[a-z]\s+[a-z]\s+[a-z]/




Don't want to miss updates? Please click the below button!

Follow MindStick