HOW TO WRITE REGULAR EXPRESSION FOR "XYZ XYX 15 16 B B A "?

Goti Bandu

Total Post:119

Points:835
Posted by  Goti Bandu
.NET  C# 
C#
 959  View(s)
Ratings:
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.

  1. Anchal Kesharwani

    Post:10

    Points:70
    Re: How to write regular expression for "xyz xyx 15 16 b b a "?

    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]/



Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!