You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately the .match follows the standard Javascript Regex engine behavior of string.test returning true if there is a partial match. This behavior works great except for a few examples.
Example)
constfreeRegex=/fr[e3]|[e3]|[e3] money/i;
This regular expression will register as match for the phrase fr33 mon3y despite that logic tells us there shouldn't be. I want a method that runs String.match from the input ( fr33 mon3y) on freeRegex. From there I want to compare if the the first match (index 0 ) from the return value) is equal to original input.
It would be the equivalent of running something to the following as a one line assertion.
Unfortunately the
.match
follows the standard Javascript Regex engine behavior ofstring.test
returning true if there is a partial match. This behavior works great except for a few examples.Example)
This regular expression will register as match for the phrase
fr33 mon3y
despite that logic tells us there shouldn't be. I want a method that runsString.match
from the input (fr33 mon3y
) onfreeRegex
. From there I want to compare if the the first match (index 0 ) from the return value) is equal to original input.It would be the equivalent of running something to the following as a one line assertion.
The text was updated successfully, but these errors were encountered: