CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Posts
    6

    Regular Expresion Help

    How i can define regular expression for following cases

    A100123456, 1B00345787

    1- here i want first two charcters as alphanumeric
    2- next two characters must be 00 (zero)(zero)
    3- next six characters must be numeric 0-9

    what will be the regular expression for the above

    Regards,

    gfaryd

  2. #2
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: Regular Expresion Help

    Although I'm a bit rusty in RegEx - something like:
    Code:
    (\d|\w){2}00\d{6}
    I would think.

    the \d|\w means either a digit or a "word" and the {2} means two of them.
    00 - to match the 00
    and \d{6} to match 6 digits.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured