I am trying to write a regex format to check the following type string:
40/4
The following features I need:
- the string will be exactly four characters long
- 1st character will have to be 1-9
- 2nd character will have to be 0-9
- 3rd character will have to be a forward slash (/)
- and 4th character will have to be 0-9
Here's what I ended up writing:
"/^.{4}$[1-9][0-9][\/][1-9]/"
Please help me to write the correct format.
Thanks