Hi,
I'm trying to write a regex to validate part or model numbers.
These can contain letters, numbers, '-', '/' and spaces. They must contain at least 1 number and be between 4 and 20 characters long.
Here are some examples of the strings I want to match:
CVA 620 999
M3094
26250
APL8215/APL8225
1301
02-700401
This is what I have so far
([\w- /]*\d){3,19}
It seems to be working apart from it will match strings such as "This is my model APL8215", I only want it to match the "APL8215" part.
Is there anyway to match model numbers like this using regular expressions?
Any help very much appreciated!