Having developed a JavaScript regular expression, we discovered some strange behavior.
For the following pattern: [\'-=]
The *
character is accepted. ( '
, -
, =
also accepted, but this is expected.)
We can replace '=' with any character. If we change the character order of the patterns, it no longer works.
Has anyone got an idea about this?
source share