Python Interviews: Difference between revisions

Line 191:
= Regex =
 
Positive lookahead (?=REGEX_1)REGEX_2 (?=regex) t(?=s) matches the second t in streets.
Negative lookahead (?!REGEX_1)REGEX_2 (?!regex) t(?!s) matches the first t in streets.
Positive lookbehind (?<=regex) (?<=s)t matches the first t in streets.
Negative lookbehind (?<!regex) (?<!s)t matches the second t in streets.