The question is about PERL regular expressions.
I need to match a string that
- starts with
<and ends with> - must contain number
[0-9] - can optionally contain
\s(i.e. space) and, - any number of characters
- order is random
This pattern does not discriminate between mandatory and optional characters:
/<[0-9,\s]+>/
and will match:
<9>
<9,10>
<9, 10>
which is what I want, but also these two that I dont want:
< >
<,>
So, how to set a PERL regex that will find a match that will always contain 0-9 and can optionally contain \s, ?