looking for a regular expression in javascript which can test a string that has 4 alphabets and 7 Numeric values exp "ABCD1234567"
^ means start
$ means end
[A-Z] means from A to Z in uppercase
[a-z] means from a to z in lowercase
\d or [0-9] means from 0 to 9
{4} means repeat times of the expression (eg. 4 here)
so for your case, this regex should works
/^[A-Z]{4}[0-9]{7}$/
If both uppercase & lowercase need to be supported, you can write
/^[A-Za-z]{4}[0-9]{7}$/
or add a case insensitive regex flag i
/^[A-Z]{4}[0-9]{7}$/i
You can read about Regex document here
You can also reach out regex101 to learn more about regex and test it online.