-
Notifications
You must be signed in to change notification settings - Fork 210
Continuation of lookahead true vs. false case. #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You didn't need to open a new issue: you can comment on closed issues..... I cannot comment on the workings of regex101, only on the way PCRE2 actually matches. The pattern you quote above matches EITHER "if" when not preceded by a colon OR "mike". If regex101 says there are two matches, maybe it is doing a global match? PCRE2 version 10.42 2022-12-11 |
The comment button wasn't activated after trying to enter a comment on the last issue #178. Your listing above is what regex101 shows as two matches when only expecting one. However, below is an example from their website for the postiive lookahead which works as expected should one change the pattern from "is" to "isa" which highlight the true vs. false even the the groups are OR'd. The regex101 help on positive lookahead (?(?=...)yes|no) True casae highlights "is delicious" Final outcome: I will close this problem since I have the global flag set which causes the multiple match. If turned off it will only match one or the other. If multiline turned on only, then it will match one or the other too. So I was mistaken. The help info also stated "Global flag breaks conditionals." which I didn't catch. |
Not sure if that might change in the future, but usually the comment button activates itself once anything is written. |
Based on premature closure of #178 before I could respond.
Please explain why it highlights both for the following at regex101 to match both if and mike when one should only be highlighted based on the help at regex101 to match true or false. It should match true only which is if . Regex101 says there's two matches.
If the positive lookahead is to match both, then the help files everywhere on the internet need to be corrected.
(?<=[^:])(if)|(mike)
string: Is candy if or mike?
The text was updated successfully, but these errors were encountered: