Python Interviews: Difference between revisions

Line 188:
['-10', '-8', '4', '3', '2', '1']
</pre>
 
= 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.