user3750290 user3750290 - 4 months ago 15
Javascript Question

Regular Expression search to search exact match

I am very much new to regex.

I have a scenario where I need to check the textbox value to the below format:

Format: AZnnnnnnn-nnn

The value has to start with "AZ" followed by 7 numerics and -(hiphen) and followed by 3 numerics

Can someone help on this


You can use this regex:


^       -> start of string
AZ      -> AZ
\d      -> digit
{7}     -> exactly 7
-       -> hyphen
{3}     -> exactly 3
$       -> end of string