I want to code a regular expression to match alphanumeric strings with the following constraints:
- Contains at least one character (a-zA-Z)
- Does not contain the name of the months of the year
- Accepts any symbol or character
- length between: 8 and 90
- Valid strings: "ABG-1234","ABG_3423", "ZIZ@342!2324^$^$^"(){}, "1982TEST", "09 87 34 56 aaa"
- Invalid strings: "123456789", "1234", "JANVIER 89", "DEC 345", "333"
Possible solution:
^ # anchor at the start
(?=.*\d) # must contain at least one numeric character
(?!.*(?:JANVIER|F[Eé]VRIER|MARS|AVRIL|MAI|JUIN|JUILLET|AO[Uù]T|SEPTEMBRE|OCTOBRE|NOVEMBRE|D[Eé]CEMBRE|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))#Does not contain any month name
(\w) # Any Character
(?=.*[a-z]) # must contain one lowercase character
(?=.*[A-Z]) # must contain one uppercase character
.{8,90} # From 8 to 10 characters in length
$ # anchor at the end"