Posted by Gunnar Hjalmarsson on 06/15/05 19:34
Captain Dondo wrote:
> I am trying to pull out an href from a bit of javascript. I am running
> php, but the RE should be the same....
Are you sure of that?
> What I want to do is pull out the URL in the window.open call but only
> if it doesn't contain either a next=[whatever] or a prev=[whatever] tag.
<snip>
> The RE I am using is
>
> $re = '<[aA] .*image=([a-zA-Z0-9.:/-]*).*/>';
This may or may not do what you want:
$re = '<[aA][^>]+image=([a-zA-Z0-9.:/-]+)(?![^>]+(?:next|prev)=)';
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Navigation:
[Reply to this message]
|