Open
Description
URL(s)
https://GitHub.com/microsoft/referencesource/blob/master/README.md
Description
I need to match +
, -
, .
, /
or a digit. Since all characters from -
to 9
are in the ASCII range I need I used @"[+\--9]"
(i.e. "match +
or any single character from -
to 9
") as the Regex pattern.
However, the following expression:
System.Text.RegularExpressions.Regex.IsMatch(input: "3", pattern: @"[+\--9]")
returns false
.
I made sure I followed Microsoft's Positive character group instructions.
To double-check, I tried it at various online Regex tester websites (Regex101, RegExr, RegexLearn) and they all matched 3
when I provided [+\--9]
as pattern and 3
as input.
Expected behavior:
The expression
System.Text.RegularExpressions.Regex.IsMatch(input: "3", pattern: @"[+\--9]")
returns true
.
Actual behavior:
The expression
System.Text.RegularExpressions.Regex.IsMatch(input: "3", pattern: @"[+\--9]")
returns false
.