According to the MSDN documentation, the .
character
Matches any single character except \n.
In this case, why does this regex not match?:
Regex.IsMatch("c",@"[.]")
You are matching [.]
which means character .
. Use just .
to get your result. The []
mean any of the character inside. So by .
loses its special meaning because of this.
See demo.
http://regex101.com/r/qC9cH4/19
c
is being captured by the second group, not the first one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With