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
I think the explanation in the docs is correct as written. The regex (?<=-)\w+ matches a word immediately preceded by a hyphen. In the example, the matched text 'egg' is the word directly following the hyphen in 'spam-egg'. The pattern for “a word followed by a hyphen” would be a lookahead, not a lookbehind, and would be written something like \w+(?=-).
Documentation
In positive lookbehind assertion (?<=...), the second example has an error on its explanation:
It says "This example looks for a word following a hyphen:"
It should say "This example looks for a word followed by a hyphen:"
The text was updated successfully, but these errors were encountered: