We need to write a RegEx which can validate a CAGE Code
A CAGE Code is a five (5) position code. The format of the code is
We came up with a RegEx cageCode = new RegEx(/^[a-zA-Z0-9]{5}$/)
which is not properly validating the requirements given.
What could be the possible regEx which could validate the requirements mentioned?
You're trying to match 5 characters which could be either numbers or letters. Try something like this:
^\d(?:(?![ioIO])[A-Za-z\d]){3}\d$
To break it down: