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
The core problem appears to be that the parser isn't treating regular expression literals as literals. In the example above, the slashes in /^#/ should be treated as delimiters, similar to quotes around a string literal "like this."
A similar problem can be observed when putting quotes inside a regular expression literal. Consider the case where the code might want to replace quote marks inside a variable with something else, such as blanks (removing the quotes).
MyVar ="The \"quick brown fox\" jumped over the lazy dogs."gsub(/"/, "", MyVar)
^--> display error here due to parser not understanding the RE literal
In this case, the parser treats the second slash (closing the RE literal) onwards as part of a string, started by the quote inside the RE literal.
Might have already fixed this at some other time. Only issue I could see now was that the enclosing / wasn't both scoped as string.regexp. Just pushed a fix for that at least.
If a regex contains a hash
#
the rest of the characters are incorrectly treated as a comment.Desired Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: