The regex you've shown us with the -
escaped does not accept ===
.
But if -
is not escaped, ===
will be accepted. See this.
A -
inside a regex is special and is used as range operator if it's not escaped and is surrounded by characters which participate as min and max in the range:
[a-z]
matches any lowercase character.
[-az]
matches either a -
or a
or z
.
[az-]
matches either a -
or a
or z
.
[a\-z]
matches either a -
or a
or z
.
[a-c-d-f]
matches a
or b
or c
or -
or d
or e
or f
. The first and last -
act as range operator but the one in the middle is treated literally.
In your case the =
comes in the range "-@
and hence gets matched.