anarchoi Posted February 7, 2008 Share Posted February 7, 2008 i'm trying to remove anything between parentheses in $meuh2 i tryed this: $result = preg_replace ("/((.*))/", "new stuff", $meuh2); but it won't work Also, would it be possible to do the replacement only if the parentheses are at the BEGINNING of $meuh2 ? thanks Link to comment https://forums.phpfreaks.com/topic/89829-solved-preg_replace-help/ Share on other sites More sharing options...
effigy Posted February 7, 2008 Share Posted February 7, 2008 Parentheses are metacharacters, so they must be escaped when you want to match literals. /\A\(.*?\)/ Link to comment https://forums.phpfreaks.com/topic/89829-solved-preg_replace-help/#findComment-460834 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.