DEV Community

Discussion on: My Regex Cheatsheet - 25 Example Regex Rules

Collapse
 
sandyaxes profile image
Sandyaxes

thanks for clarity on regular expressions, hopefully you could help I'm having trouble constructing a suitable expression that can accept University module codes that are in this format ("SCPS212", "CSPR111", "ADS213",...etc.) four letters or three and three numbers at the end.

I've tried pattern = "^[A-Z0-9]{6,7}$" and also tried hard coding them, it works that way but my lecture don't want me to hard code them.