Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Reg Ex

Name: Anonymons 2009-10-25 16:23

im trying to make a regular expression that will capture URLs, but not URLs encased in HTML Tags (anchor, image, ect).

this is what i got so far. it'll find the URL (copypasta from MSDN) but its still capturing HTML elements:


(?!((href|url|src)=[""']?))(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/
?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?

Name: Anonymous 2009-10-25 16:33

Oh god. I've never even tried to read a Regex toot

Name: Anonymons 2009-10-25 16:44

try to focus on this part then, where im trying to omit HTML tags.  the rest of it just matches a URL type string:

(?!((href|url|src)=[""']?))

Name: Anonymous 2009-10-25 16:47

(?!((href|url|src)=[""']?))
(?<!((href|url|src)=[""']?))

Name: Anonymous 2009-10-25 16:49

\-\.\?\,\'\/\\\+&amp;%\$#_]
don't need to escape all that shit, bro

Name: Anonymous 2009-10-25 16:50

>>4
oh shi-

....i think that worked.

Name: Anonymous 2009-10-25 16:51

Name: Anonymous 2009-10-25 16:55

>>4
yeah, it worked.  you are a genius!!!

Name: Anonymous 2009-10-25 17:01

>>4
remember to account for arbitrary whitespace.

Name: Anonymous 2009-10-25 18:18

HTML
regular expression
IHBT

Name: Anonymous 2011-01-31 21:06

<-- check em dubz

Name: Anonymous 2011-02-02 22:52

Name: tray 2012-03-14 23:00


Don't change these.
Name: Email:
Entire Thread Thread List