I'm almost there but not quite. I've done some looking around but while there are similar questions out there, this is as much about a single regex covering multiple scenarios as it is about the regex semantics of achieving tasks a, b or c etc.
I'm trying to construct a regex which allows either a single number or two numbers or any number of white spaces or an empty string. These are sent from an input field.
/[0-9]{1,2}|\s*/
very nearly does it except it accepts a number followed by a letter so '3r' would be a match.
/[0-9]?\d|\s*/
has the same effect.
I'm very new to this and suspect I'm missing something basic. Anyone have any ideas?
Thanks