We help IT Professionals succeed at work.

Regular Expression Number Range

1,075 Views
Last Modified: 2008-07-09
Hi all,

  I am writing a regular Expression in Javascript which needs to match the following;

AB1 through AB15, AB17, AB19  and AB77

Quick response needed!

MANY THANKS!
Comment
Watch Question

Ali KayahanFull Stack Developer

Commented:
[a-zA-Z]{2}\d+

Author

Commented:
thanks for your reply. I need the expression to match those exact details though, not just any 2 letters or digits.

if someone can provide me with an expression to match AB1 though AB15 , or even 1 through 15 I will  accept that !

thanks again.
Ali KayahanFull Stack Developer

Commented:
Than try this one...
AB[0-9]{2}

Author

Commented:
i tried  it, but  its not matching the number range 1 through 15......


regards
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
Thanks for the question and the points.  I question the grade though I that pattern was exact, was there something more you were asking for that I did not provide?
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.