Regular Expressions 101

Community Library

Community Library Entry

-2

Regular ExpressionOpen Workspace

/
\((?!([^\(\)\[\]]*(\b)(ARR|ARRANGEMENT|ARRANGEMENTS|ARRANGED|CHOPPED|DUB|EDIT|FT|FEAT|FEATURING|INSTRUMENTAL|MASH UP|MASHUP|MASH-UP|MIX|REMIX|REPRISE|SCREWED|TITLE|VERSION)(\b)[^\(\)\[\]]*)).*?\)
/
g

Description
Created·2015-02-23 22:13
Type·Substitution
Flavor·PCRE (Legacy)

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
Open Workspace