Course of Raku / Regexes and grammars / Regexes
Lookaround assertions
Sometimes you want to match something only because of what comes next to it, without making that neighbour part of the match. A lookaround assertion checks the text ahead of or behind the current position but does not consume it.
There are two directions — lookahead (what follows) and lookbehind (what precedes) — and each comes in a positive and a negative form. Like anchors, assertions match a position, not characters.
Topics in this section
Practice
Complete the quizzes that cover the contents of this section.
Exercises
This section contains 3 exercises. Examine all the topics of this section before doing the coding practice.