Search⌘ K

Python Lookbehind

Explore the use of positive and negative lookbehind assertions in Python regular expressions to match patterns based on preceding text conditions. This lesson helps you understand how to identify or exclude matches based on context within strings, improving your ability to write accurate and efficient regex in Python.

We'll cover the following...

Positive Lookbehind

(?<=regex) Matches at a position if the pattern inside the lookbehind can be matched ending at that position. ...