Forum Moderators: coopster

Message Too Old, No Replies

extracting image links from href with regexp

         

phazei

7:54 am on Aug 8, 2007 (gmt 0)

10+ Year Member



I'm trying to extract only image links from <a href="b.jpg">
I've found some examples but they use .* and that seems to over shoot everything.

I'm trying to use lookahead to keep going until a string is found.
Just like [^"]* will keep going until a " is found.

I can't get:
string[^(hi)]*
to work like I want it to.
What I want is for it to match:
asdf string asd salkd . sd.s le h asd i lsdf hi adsa hi
from the "string" to "hi" and not stop at the first "h" or "i" or the last "hi" when using .*
I've tried using the ^?!?= in a ton of combinations with no help.

Help..

Thanks,
Adam

ahmedtheking

9:49 pm on Aug 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This may be a pain, but there's so many examples on this page: [uk.php.net...]