Python Lookahead

Python look ahead explained.

Positive Lookahead

Python positive lookahead matches at a position where the pattern inside the lookahead can be matched. Matches only the position. It does not consume any characters or expand the match.


Consider the following string:


Positive lookahead assertion can help us to find all words followed by the word scientific.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy