I am trying to make a regular expression for consumer products models.
I have this regular expression: ([a-z]*-?[0-9]+-?[a-z]*-?){4,}
which I expect to limit this whole special string to 4 or more but what happens is that the limit is applied to only the digits.
So this example matches: E1912H
while this does not: EM24A1BF
although both should match.
Can you tell me what I am doing wrong or how can I make the limit to the whole special string not only the digits?
Limitations:
1- String contains at least 1 digit
2- string can contains characters
3- string can contain "-"
4- minimum length = 4