Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Alternatives are left-to-right, not greedy: In the string
<U+2E09 LEFT TRANSPOSITION BRACKET, U+2E0D RIGHT RAISED OMISSION BRACKET, U+1F3FC EMOJI MODIFIER FITZPATRICK TYPE-3>,
Searching for
( ^ | [^[\p{ea=F}\p{ea=W}\p{ea=H}]] ) \p{Line_Break=Quotation}
will find a match consisting of the first character, whereas searching for( [^[\p{ea=F}\p{ea=W}\p{ea=H}]] | ^ ) \p{Line_Break=Quotation}
will find a match consisting of the first two characters.ICU depends on a maximal match in its generated old monkeys: https://github.com/unicode-org/icu/blob/02951053b45f270c04ffeac6e0787dd2313bbd23/icu4c/source/test/intltest/rbbitst.cpp#L1779. This is messy to solve in general, but our alternatives here are simple enough that we can make them greedy by moving sot at the end.
Specifically, this works because except for sot, these alternatives are really unions of character classes. We could prohibit alternatives altogether and use unions of character classes, splitting the sot case into its own sub-rule, but that would be a divergence from the UAX14 formulation, which seems worse.