passing multiple strings to string.find()
fredrik at pythonware.com
Fri Aug 8 15:35:44 CEST 2003
Francois Pinard wrote:
> Given the above,
> build_regexp(['this', 'that', 'the-other'])
> yields the string 'th(?:is|at|e\\-other)', which one may choose to
> `re.compile' before use.
footnote: the SRE compiler looks for common prefixes, so "th(?:is|at|e\\-other)"
is no different from "this|that|the-other" on the engine level.
More information about the Python-list