0

I have the following complex regex pattern :

(((([0-9])?[A-Z]{1,})(([A-Z0-9./+]+){0,}-){1,})[A-Z0-9./+]+\=*)

which matches the following strings.

GCD-800F-RM-19
RCS8XX-256U512D=
CDE-HY14-2RJ11++

I need to set a minimum and maximum length for this pattern now, as I don't want a match for the following words : IP-IP , CD-X etc.

How can I set the minimum length as 5 and max length as 18 for the above pattern?

Please find the link for online editor here: https://regex101.com/r/GblzUj/5

Sebastian Proske
  • 7,985
  • 2
  • 26
  • 36
Amrutha
  • 21
  • 4

0 Answers0