I’m using URI segments to match a form of ID and basically I want it to match strings of up to 5 characters only.
How do I go about regex for this? This is what I have so far but it doesn’t work – which is why I’m here:
/([a-zA-Z0-9*]{5})(?![a-zA-Z0-9*])/
Use either
or
if you want to also accept empty inputs.
^and$denote the start/end of the input string.