Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
PCRE (PHP <7.3)

/
[(](?!([^)]*\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

strip parentheses enclosed text with no keywords - handles nested parentheses - if using brackets/braces normalize string to parentheses then use the regex

Submitted by marie bacuno - 10 years ago