javascript - Regex For Letters/Numbers combination -


trying come regex capture groups ab1234 or ba2321. need capture starts ab or ba , followed 4 digits.

currently, have this, seems not take numbers account

(ab|ba)\d{4} 

may want:

\b((?:ab|ba)\d{4})\b 

letters + digits in group 1


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -