Re: Some RegEx help please
| From: | James Atkinson | Date: | Thu, 14 Sep 2000 23:15:00 +0000 |
| Subject: | Re: Some RegEx help please | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16862@lists.php.net to get a copy of this message | ||
On Thu, 14 Sep 2000, Joe Sheble aka Wizaerd wrote:
> Actually, I guess I left something out, but before I dive into that, this
> won't work if it's the first thing in a string because of the space at the
> begin of the search pattern...
>
> BUT, this won't quite work for me because this interferes with legitimate
> URLS in the given text.
>
> If my text is as follows, I only want the URLs that are not already
> surrounded by an <A HREF=""> tag to be converted
>
> $cBlah = "this <A HREF="http://www.somepage.com"ïqŠÒ]ºÊ
> ÐÃÆÚ 3ô>tag</A> would not convert,
> but this one http://www.someotherpage.com would
> convert...";
Yes, it mangles HREF tags, thats the reason there is a space at the beginning
of the search pattern. The draw back of keeping it from mangling href tags is
that it dosan't work if its the first thing in the string. To be hounest I
don't 100% understand this regex. I just borrowed it from phpwizard.net :)
--
James Atkinson
-----------------------------------------------------------------
James Atkinson 100world
Technical Developer 512-1529 West 6th Avenue
phone: +1-604-637-8122 Vancouver, BC, V6J 1R1
fax: +1-604-742-1770 Canada
email: james.atkinson@100world.com http://www.100world.com
+---------------------------------------------------------------+
| This message may contain confidential and/or privileged |
| information. If you are not the addressee or authorized to |
| receive this for the addressee, you must not use, copy, |
| discolse or take any action based on this message or any |
| information herein. If you have received this message in |
| error, please advise the sender immediately by reply e-mail |
| and delete this message. Thank you for you cooperation |
+---------------------------------------------------------------+