File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1038,8 +1038,11 @@ true
1038
1038
```
1039
1039
1040
1040
Note the use of the ` \Q...\E ` escape sequence. All characters between the ` \Q ` and the ` \E `
1041
- are interpreted as literal characters (after string interpolation). This escape sequence can
1042
- be useful when interpolating, possibly malicious, user input.
1041
+ are interpreted as literal characters. This is convenient for matching characters that
1042
+ would otherwise be regex metacharacters. However, caution is needed when using this feature
1043
+ together with string interpolation, since the interpolated string might itself contain
1044
+ the ` \E ` sequence, unexpectedly terminating literal matching. User inputs need to be sanitized
1045
+ before inclusion in a regex.
1043
1046
1044
1047
## [ Byte Array Literals] (@id man-byte-array-literals)
1045
1048
You can’t perform that action at this time.
0 commit comments