In PHP, using preg_replace
, how do I write a regular expression so that any phrase, except "The," in parenthesis & preceded by a space is deleted. E.g.,
Concordia University (Anything But The) => Concordia University
American University (The) => American University (The)
Does preg_replace
support negative lookaheads? If so you can do something like this...
\((?!The\)).*?\)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With