Re: [PHP] help with preg_replace pattern

2010-01-26 Thread Adam Richardson
On Tue, Jan 26, 2010 at 10:37 PM, Rob Gould wrote: > It appears that IE renders it's display: none in all caps while Firefox and > other browsers pass it back in lowercase. This throws off my php line of > code the is supposed to nuke blank bullets from a string of text: > $bl = > > > > > >

[PHP] help with preg_replace pattern

2010-01-26 Thread Rob Gould
It appears that IE renders it's display: none in all caps while Firefox and other browsers pass it back in lowercase. This throws off my php line of code the is supposed to nuke blank bullets from a string of text: $bl = Reserved Frontstretch Tower Ticket to the NextEra Energy Reso

[PHP] Help with preg_replace

2007-11-07 Thread Richard Luckhurst
Hi I am in the process of porting a Perl application to PHP and I have hit a snag with trying to substitute test within a file. I have looked at the PHP manual and believe I should be using preg_replace but I have tried the examples and am not getting the result I would expect. I would appreciate

Re: [PHP] help with preg_replace only part of the string

2005-12-06 Thread Miles Thompson
At 07:06 AM 12/6/2005, Richard Heyes wrote: Georgi Ivanov wrote: Hi, I want to replace the content of html links : name="bla">REPLACETHIS. $html=preg_replace("/()(.*)<\/a>/isU",$link,$html,1); This generally works but removes , tags too. How to make it work without removing anything else than (

Re: [PHP] help with preg_replace only part of the string

2005-12-06 Thread Richard Heyes
Georgi Ivanov wrote: Hi, I want to replace the content of html links : name="bla">REPLACETHIS. $html=preg_replace("/()(.*)<\/a>/isU",$link,$html,1); This generally works but removes , tags too. How to make it work without removing anything else than (.*) in the middle of .* $html = preg_repl

Re: [PHP] help with preg_replace only part of the string

2005-12-06 Thread David Grant
Replace the middle (.*) with ([^<]*). This tells the regex engine to ignore new opening tags. Cheers, David Georgi Ivanov wrote: > Hi, > I want to replace the content of html links : name="bla">REPLACETHIS. > > $html=preg_replace("/()(.*)<\/a>/isU",$link,$html,1); > This generally works but r

Re: [PHP] Help with preg_replace

2005-07-04 Thread Jason Wong
On Tuesday 05 July 2005 02:21, Marcos Mendonça wrote: > This works fine for links with id 0, 1 and 4. But i haven´t been able > to figure out how to match and replace links with id 2 and 3. Works for me. Check whether $body_html really does contain what you're looking for in id 2 & id 3. You ma

[PHP] Help with preg_replace

2005-07-04 Thread Marcos Mendonça
Hi list I need help to solve a preg_replace() problem. I have a snippet of html code that contains some links. I have an array thats contains all links inside that snippet of html code. What i need to do is replace all the links in the code by another on. So this is what i´m trying to do: //l

Re: [PHP] Help with preg_replace

2004-01-19 Thread John Nichel
John W. Holmes wrote: In $url, the periods still need to be escaped, too. This is where preg_quote() comes in handy. $url = "http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]";; $url = preg_quote($url); $code = preg_replace("#$url#",$replace,$code,1); I hope the OP took notice of the

Re: [PHP] Help with preg_replace

2004-01-19 Thread John W. Holmes
joel boonstra wrote: The problem is that there are still special chars that need escaping. Specifically, the question mark (?) and the square braces ([]). Here is some modified code (apologies for poor word-wrapping): http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah "; $url = "'

Re: [PHP] Help with preg_replace

2004-01-19 Thread Jason Wong
On Tuesday 20 January 2004 01:31, John Clegg wrote: > Is there any php command to delimit all of these characters as I am > getting the string I am trying to replace from the database. preg_quote() -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators

Re: [PHP] Help with preg_replace

2004-01-19 Thread John Nichel
John Nichel wrote: John Clegg wrote: Hi I have just realised that I have to delimit the following characters so I can use preg_replace: / ? [ ] Is there any php command to delimit all of these characters as I am getting the string I am trying to replace from the database. eg. \? Any ideas

Re: [PHP] Help with preg_replace

2004-01-19 Thread John Nichel
John Clegg wrote: Hi I have just realised that I have to delimit the following characters so I can use preg_replace: / ? [ ] Is there any php command to delimit all of these characters as I am getting the string I am trying to replace from the database. eg. \? Any ideas John Maybe addslash

Re: [PHP] Help with preg_replace

2004-01-19 Thread joel boonstra
On Mon, Jan 19, 2004 at 07:15:53PM +0200, John Clegg wrote: > Hi Joel, > > Thanks for the reply. > > I have tried using "/" to delimit the string and I get the following error > > String > > $url = "/http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]/";; > > Gives the error: > *Wa

Re: [PHP] Help with preg_replace

2004-01-19 Thread John Clegg
Hi I have just realised that I have to delimit the following characters so I can use preg_replace: / ? [ ] Is there any php command to delimit all of these characters as I am getting the string I am trying to replace from the database. eg. \? Any ideas John John Clegg wrote: Hi Joel, Tha

RE: [PHP] Help with preg_replace

2004-01-19 Thread craig
> Hi Joel, > > Thanks for the reply. > > I have tried using "/" to delimit the string and I get the > following error > > String > > $url = > "/http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]/";; you have to escape all of the slashes execpt the first and last that delineate the re

Re: [PHP] Help with preg_replace

2004-01-19 Thread John Clegg
Hi Joel, Thanks for the reply. I have tried using "/" to delimit the string and I get the following error String $url = "/http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]/";; Gives the error: *Warning*: Unknown modifier '/' in* /test.php* on line *8* I found out that I could use

Re: [PHP] Help with preg_replace

2004-01-19 Thread John Nichel
John Clegg wrote: Hi I am having some problems with preg_replace and I wondering if someone could suggest a fix or explain why it is not working. Here is the Code: * http://www.foo.com/Unsubscribe.php?EmailAddress=[MAIL] blah"; $url = "'http://www.foo.com/maxbid/Unsubscrib

Re: [PHP] Help with preg_replace

2004-01-19 Thread joel boonstra
On Mon, Jan 19, 2004 at 06:50:37PM +0200, John Clegg wrote: > Hi > > I am having some problems with preg_replace and I wondering if someone > could suggest a fix or explain why it is not working. > > > > Here is the Code: > * > $code = "blah http://www.foo.com/Unsubscribe.

[PHP] Help with preg_replace

2004-01-19 Thread John Clegg
Hi I am having some problems with preg_replace and I wondering if someone could suggest a fix or explain why it is not working. Here is the Code: * http://www.foo.com/Unsubscribe.php?EmailAddress=[MAIL] blah"; $url = "'http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=

Re: [PHP] help with preg_replace please

2003-03-26 Thread CPT John W. Holmes
> I get the following error: > > Parse error: parse error, expecting `T_VARIABLE' or `'$'' in > /usr/local/apache/htdocs/lib/lib_string.inc on line 218 > > Using this code: > $str = > preg_replace("!([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])!ei", " href=\"{$1}://{$2}{$3}\">{$2}{$3}", $str);

Re: [PHP] help with preg_replace please

2003-03-25 Thread Jason Paschal
what that guy said, or use ereg_replace instead of preg_... From: Jason Wong <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] help with preg_replace please Date: Wed, 26 Mar 2003 14:08:44 +0800 On Wednesday 26 March 2003 13:59, Justin French

Re: [PHP] help with preg_replace please

2003-03-25 Thread Jason Wong
On Wednesday 26 March 2003 13:59, Justin French wrote: > Parse error: parse error, expecting `T_VARIABLE' or `'$'' in > /usr/local/apache/htdocs/lib/lib_string.inc on line 218 > > Using this code: > $str = > preg_replace("!([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])!ei", " href=\"{$1}://{$2

[PHP] help with preg_replace please

2003-03-25 Thread Justin French
Hi, Total newbie on reg exps, and even worse with preg!!! I get the following error: Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /usr/local/apache/htdocs/lib/lib_string.inc on line 218 Using this code: $str = preg_replace("!([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])!ei

[PHP] Help with preg_replace() , PLEASE

2003-03-13 Thread fLIPIS
I'm going mad about this. Now, i've got the following text: - BEGIN TEXT -- Let's see a very simple class sample And this was the sample -- END TEXT --- I'm using preg_rep

Re: [PHP] help with preg_replace()

2002-07-01 Thread Analysis & Solutions
On Mon, Jul 01, 2002 at 01:50:31PM +0200, Gregor Jak¹a wrote: > > "word" = "word" > >word = >| word | > >"word = >|word | > > preg_replace("#^[<|>]?[^\"](.*?)[^\"]$#i", "| \\0 |", $string); preg_replace('/^(<|>)+"?([^"]*)"?$/', '\\1| \\2 |', $string); I noticed that when there are quotes, yo

[PHP] help with preg_replace()

2002-07-01 Thread Gregor Jak¹a
ive been tryin to find a solution for this problem for some hours now, but i just dont know how to do it... so i ask for ur assistance. Lemme list some examples, so u can see what im tryin to do :) "word" = "word" >word = >| word | "word = >|word | "word it should replace it with >|word | and so o