Regex: Limiting Scope without capturing results

Skip Montanaro skip at pobox.com
Thu Jul 24 16:14:42 EDT 2003


    Gordon> If I remove the ()s around the string|float|color match it stops
    Gordon> matching anything, so is there an alternative to these ? Or a
    Gordon> way of telling them to limit the scope of the match without
    Gordon> capturing the result ?

Sure, use (?:<pattern>).  Full details at 11:

    http://www.python.org/doc/current/lib/re-syntax.html

Skip





More information about the Python-list mailing list