In PHP, using preg_replace
, how do I write a regular expression so that any phrase, except "The," in pa开发者_如何学JAVArenthesis & 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\)).*?\)
精彩评论