Regular Expressions 101

Community Patterns

strip text enclosed in parentheses that does not match any keyword(s)


Regular Expression
PCRE (PHP <7.3)



strip or remove parentheses enclosed text - including the parentheses itself - only if the enclosed text does not contain any of the FULL keyword(s). Leave all parentheses enclosed text if it contains any keyword(s) listed in the regex string. Uses negative lookahead and \b for determining word boundaries. For PostgreSQL, replace \b with \y for word boundaries.

Submitted by marie bacuno - 9 years ago