Lookaround
Pattern | Meaning |
---|---|
(?= ) |
Lookahead, if you can find ahead |
(?! ) |
Lookahead,if you can not find ahead |
(?<= ) |
Lookbehind, if you can find behind |
(?<! ) |
Lookbehind, if you can NOT find behind |
\b\w+?(?=ing\b) |
Match warbling, string, fishing, … |
\b(?!\w+ing\b)\w+\b |
Words NOT ending in "ing" |
(?<=\bpre).*?\b |
Match pretend, present, prefix, … |
\b\w{3}(?<!pre)\w*?\b |
Words NOT starting with "pre" |
\b\w+(?<!ing)\b |
Match words NOT ending in "ing" |
Comments