A dot .
in a regular expression matches any single character. In order for regex to match a dot, the dot has to be escaped: \.
It has been pointed out to me that inside square brackets []
a dot does not have to be escaped. For example, the expression:
[.]{3}
would match ...
string.
Doesn't it, really? And if so, is it true for all regex standards?
(
or?
so that at a glance you can see "this is a literal" without thinking about the context of where that token is (esp. with any crazy nesting)..
, which matches any character. But wait, what use is a character class that matches any character?