I am creating a Regex and so far I did this and tried it,
^([0][1-9]|1[0-2])[/-.]
and I get the following error.
p
The problem is with this part:
[/-.]
That means "the range of characters from '/' to '.'" - but '/' comes after '.' in Unicode, so the range makes no sense.
If you wanted it to mean "slash, dash or period" then you want:
[/\-.]
... in other words, you need to escape the dash. Note that if this is in a regular C# string literal, you'll need to perform another level of escaping too:
string pattern = "[/\\-.]";
Using a verbatim string literal means you don't need to escape the backslash:
string pattern = @"[/\-.]";
Alternatively, as Jay suggested, you can just put the dash at the start:
[-/.]
or end:
[/.-]
(I've just tested, and all three of these options work.)