|
|
 |
Re: FN-FORUM RegExpresions...
date posted 19th December 2002 11:55
----- Original Message -----
From: "John Wards" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Thursday, December 19, 2002 11:18 AM
Subject: FN-FORUM RegExpresions...
> I have a regexp problem
>
> I want to go through some HTML and where I
want
> to change it to this
>
> BUT
>
> if the image tag is like this
>
>
>
> already I don't want anything to happen........
>
> I thought this would do it:
>
> ereg_replace("src="(^http)","src="http://www.domain.com/", $string);
>
> but it didn't...............
does not contain src= "(^http)
^ is start for line and there is no http ( I assume you wanted
[^h][^t][^t][^p]
^ inside [] means not, but [^http] would be not any of (h,t,p) once rather
then not "http"
I think (not checked) you want
> ereg_replace("src="([^h][^t][^t][^p])","src="http://www.domain.com/$1",
$string);
the $1 puts the first 4 chars back into the output
Mike.
>
> Argh...
>
> Cheers
> John Wards
>
>
>
> ========
> Advertise with Freelancers.net +Additions+
> http://www.freelancers.net/advert.php
>
>
> Freelancers and Freelance Jobs:
> http://www.freelancers.net
>
> Forum FAQs:
> http://freelancers.netrickery.com
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
|
 |
|