I am trying to create a Regex for a string where following rule is applied
- I need to validate the string only if first 1-3 characters (it can be 1 char,2 char or 3 char ) are numeric and after that it has a '/' symbol character
- If the 1st condition meets then i need to check whether the characters after that '/' should be any one of the following chars only ('ADD.','MOD.'), if not it should fail
- If the 1st condition doesnot meets then it should not validate the string.
i tried with this regex but i am not able to get the solution.
(?=^[0-9]{1,3}[/]{1})^[0-9]{1,3}[/]{1}[(ADD.|MOD.)]{4}|(.*)
the condition doesnot fails when i validate a string - '123/testing' it should fail
Please let me know what i am missing.
Kind Regards, D.Mahesh