Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^(?:.*? #[0-9]+ )?([^\[]+?) *(?:\[.+)?$
/

Description

Removes up to and including #n...n and including and beyond [ ' e.g. ...Baby One More Time #1 [0s]

Submitted by Chris - 9 years ago