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
Copy file name to clipboardExpand all lines: javalib/src/main/scala/java/util/regex/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -274,7 +274,7 @@ In general, we make sure that:
274
274
* something that can match a supplementary code point or a high surrogate never selects the high surrogate if it could match the whole code point.
275
275
276
276
We do nothing special for low surrogates, as all possible patterns go from left to right (we don't have look-behinds in this context) and we otherwise make sure that all code points from the input are either fully matched or not at all.
277
-
Therefore, the "cursor" of the engine can never stop in the middle of a code point, and so low surrogates are only visible if they were unpaired to being with.
277
+
Therefore, the "cursor" of the engine can never stop in the middle of a code point, and so low surrogates are only visible if they were unpaired to begin with.
278
278
The only exception to this is when the cursor is at the beginning of the pattern, when using `find`.
279
279
In that case we cannot a priori prevent the JS engine from trying to find a match starting in the middle of a code point.
280
280
To address that, we have special a posteriori handling in `Pattern.execFind()`.
0 commit comments