Jump to content

[SOLVED] Grabbing 1 too many characters


carrotcake1029

Recommended Posts

I'm not too good with regular expressions, but I am trying to learn.

 

This regex is to extract urls from html.  It skips over urls inside of tags.

Can anyone tell me why this is grabbing a character before the url.

'/[^="]http:\/\/[^ \n\r]+(?=[\<])/'

 

For instance, this is occurring atm.

The file contains this string

-->http://www.google.com<br />

and it is returning

>http://www.google.com

 

Any help is greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/137659-solved-grabbing-1-too-many-characters/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.