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
Note the use of the `\Q...\E` escape sequence. All characters between the `\Q` and the `\E`
are interpreted as literal characters (after string interpolation). This escape sequence can
be useful when interpolating, possibly malicious, user input.
these lines seem to indicate that \Q and \E can be used in a regex with unsafe, even malicious content, but I believe it can be easily defeated (name = "\\E.*\\Q")
Should the docs be updated to clarify this?
I found 2 PRs for escaping a regex but they are not merged (#29643 and #31989)
The text was updated successfully, but these errors were encountered:
Agree that this is not a good solution to protecting against potentially malicious content being spliced into a regex. I think we do have some functions for safely splicing literal content into regexes though...
Should regex interpolation try to do the safe thing by default with a flag to turn it off? We could do a similar thing to commands where if you interpolate another regex it gets interpreted, but if you interpolate a string it gets whatever processing is necessary applied to make it literal.
julia/doc/src/manual/strings.md
Lines 1030 to 1031 in e84634e
julia/doc/src/manual/strings.md
Lines 1040 to 1042 in e84634e
these lines seem to indicate that
\Q
and\E
can be used in a regex with unsafe, even malicious content, but I believe it can be easily defeated (name = "\\E.*\\Q"
)Should the docs be updated to clarify this?
I found 2 PRs for escaping a regex but they are not merged (#29643 and #31989)
The text was updated successfully, but these errors were encountered: