datalines

Conditional RegEx Matching with Python

When the endpoint of your match depends on an earlier term, try conditional regex matching in Python.