Re: regex

From: Date: Sun, 23 Mar 2003 02:40:36 +0000
Subject: Re: regex
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-140731@lists.php.net to get a copy of this message
Worked great. Thanks so much. "Leif K-Brooks" <eurleif@buyer-brokerage.com> wrote in message news:3E7D1D83.2090901@buyer-brokerage.com... > Whoops! Try this: > > preg_replace('|%INCLUDE_FILE\\[[^\\]]*\\]%|','',$final_footer); > > > Nate Sanden wrote: > > >Thanks! That worked almost. It removed everything except for the 2 % > >signs. > > > >How might I remove those as well? > > > > > >"Leif K-Brooks" <eurleif@buyer-brokerage.com> wrote in message > >news:3E7D1932.2030400@buyer-brokerage.com... > > > > > >>Try this (entirely untested!): > >>$final_footer = > >>preg_replace('%INCLUDE_FILE\\[[^\\]]*\\]%','',$final_footer); > >> > >>Nate wrote: > >> > >> > >> > >>>hi, > >>> > >>>i need to search $final_footer for a string such as > >>>%INCLUDE_FILE[/path/to/file]% (where /path/to/file could be anything) and > >>>delete it from the string. it being %INCLUDE_FILE[/path/to/file]% (not > >>> > >>> > >just > > > > > >>>/path/to/file) > >>> > >>>im new to regexps but im guessing I should use preg_match for this? > >>> > >>>Can someone give me a code example? > >>> > >>>thanks much > >>>Nate > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>-- > >>The above message is encrypted with double rot13 encoding. Any > >> > >> > >unauthorized attempt to decrypt it will be prosecuted to the full extent of > >the law. > > > > > >> > >> > >> > > > > > > > > > > > > -- > The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. > > >

« previous php.general (#140731) next »