I need my regex statement to do the following: takes:
- a-z 0-many times,
- 0-9 0-3 times,
- & 0-many times,
- " " 0-1 time,
- be a minimum of 8 characters.
I also use this website to test my code - https://regexr.com.
My regex:
([a-zA-Z&]*[0-9]{0,3}[\s]?)\w{8,}
These should work:
abcD &EFG,
ABCde f123,
&&12ADSD&&.
these should not:
a bcD &EFG,
AB5Cde f123,
&&12ADSD&&34,
1234567,
nope.
Problem is that my regex will accept any number of digits regardless of me putting my limit on it and it will accept spaces in the middle of words but unpredictably and i don't know why.
I'm new to regex so be gentle with me