Community Patterns

Community Library Entry

0

Regular Expression
Created·2018-08-13 12:10
Flavor·Python

r"
\b(?:(?!\bper)(?!\bdef).)*
"
igxm
Open regex in editor

Description

This can be changed to find all characters upto a specific pattern as well by changing the \b at the start to a simple ^.

This is useful if you want to limit your regex searches in a manner such that two pattern cases do not overlap (as regex does not currently handle overlap of cases when you chain patterns in a findall( ) using '|' . you simply preface your pattern and then add this at the end chaining any patterns you want your RegEx engine to stop at

Submitted by anonymous