1. Home
  2. Computing & Technology
  3. Python

Python Regular Expressions (regex): Two-Part Regexes ('(?=)')

By Al Lukaszewski, About.com

Definition:

The precise syntax for using this regex operator is as follows:

expression A (?=expression B)
If expression A is matched, Python then looks for expression B. If both expressions are matched, the hit is treated as a single match.


Back to the main index of this glossary

Explore Python

More from About.com

  1. Home
  2. Computing & Technology
  3. Python
  4. Regular Expressions
  5. Python RegEx Glossary
  6. Parenthetical Compounds
  7. Python Regular Expressions (regex): Two-Part Regexes ('(?=)')

©2008 About.com, a part of The New York Times Company.

All rights reserved.