Just testing out some special regex characters and just came across some behaviour I could not explain. An un escaped full-stop stands for any character, therefore (for example) matching 3 to "." returns true, however, when I match 3 to "[.]", it returns false. What is the cause of this?
Just testing out some special regex characters and just came across some behaviour I
Share
Like most other metacharacters,
.loses its special meaning in a character class (the[]). There, it just means “a dot”.