Re: preg_replace on array with "E (PCRE_DOLLAR_ENDONLY)" modifier

From: Date: Tue, 24 Apr 2001 00:57:51 +0000
Subject: Re: preg_replace on array with "E (PCRE_DOLLAR_ENDONLY)" modifier
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-49976@lists.php.net to get a copy of this message
Try switing the modifier to "e". "E" is not a supported modifier according to the manual. Only the following are supported: i m s x e A D S U X If you are trying to match a $ in your code, just use a backspace to escape it. But I don't think that was your problem... -- Plutarck Should be working on something... ...but forgot what it was. ""Grant Walters"" <Grant.Walters@walters.co.nz> wrote in message news:003801c0cc59$7d2b01a0$3d9b60cb@walters.co.nz... > Hi, > > I'm having problems stopping preg_replace from losing $ signs and following text when replacing with array variables. I am trying > to use the E modifier and keep getting: > > "Warning: Unknown modifier 'E' in script.WEB.php3 on line 413" > > $template=array( > "/({PAGETOP})/E", > "/({PAGEMIDDLE})/E", > "/({PAGEBOTTOM})/E" > ); > > $pagevars=array( > "PAGETOP" => $pagetop, > "PAGEMIDLE" => $pagetop, > "PAGEBOTTOM" => $pagenavbar, > ); > > Text from assorted sources such as database records or external files are placed into the variables $pagetop ... > > $page = "{PAGETOP}{PAGEMIDDLE}{PAGEBOTTOM}"; > $page = preg_replace($template,$pagevars,$page); > > Other modifiers seem to be accepted. Any help appreciated. > > Regards > > Grant Walters > Brainbench 'Most Valuable Professional' for Unix Admin > Walters & Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND > Telephone: +64 4 4765175, CellPhone 025488265, ICQ# 23511989 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#49976) next »