Regular Expressions 101

Community Patterns

Subparagraph

0

Regular Expression
Python

r"
^(?:(?:[Ss]ub)?(?:-)?(?:paragraph)?(?:s)?(?:\s*\([a-z]\))(?:,\s*(?:\s*\([a-z]\))?)*(?:\s*(?:[,&]|and)\s+?(?:\s*\([a-z]\)+)?)?(?:(?:\s*to)*(?:\s*\([a-z]\)))*(?:\s*of\s*)*)
"
gm

Description

Searches whether a string of cross references contains the sub paragraph part or not.

Submitted by anonymous - 4 years ago