Skip to content
This repository was archived by the owner on May 29, 2023. It is now read-only.

Conversation

robinst
Copy link
Contributor

@robinst robinst commented Aug 3, 2017

Before, e.g. a lookahead like (?=x|a) would be wrong. The delegate RE
for the x|a part inside was compiled as ^x|a. This means only the
x was anchored, but not a.

Fix it by adding a non-capturing group so that the delegate is
^(?:x|a), which results in correct anchoring in this case (and
possibly others).

Before, e.g. a lookahead like `(?=x|a)` would be wrong. The delegate RE
for the `x|a` part inside was compiled as `^x|a`. This means only the
`x` was anchored, but not `a`.

Fix it by adding a non-capturing group so that the delegate is
`^(?:x|a)`, which results in correct anchoring in this case (and
possibly others).
@raphlinus raphlinus merged commit 26344b3 into google:master Aug 11, 2017
@raphlinus
Copy link
Contributor

Thanks for the fixes, appreciated!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants