# Email addresses are wrapped in angle brackets, but only
# if both are present or neither is.
(?= (<.*>$) &...
- Chapter 1. Text
- from The Python 3 Standard Library by Example, Second Edition
- Publisher: Addison-Wesley Professional
- Released: June 2017
lookahead checks remaining part of the string for some pattern in general, after lookahead is matched detailed matching of the same remaining string is done by the further part of regexp pattern.
so, lookahead helps to have a more general match before detailed match. it helps to check for matching paired opening and closing symbols within a bigger expression. after lookahead -
Share this highlighthttp://www.safaribooksonline.com/a/the-python-3/13707398/