Regex for all url

These are old archives. They are kept for historic purposes only.
Post Reply
killerdedieu
Posts: 3
Joined: Fri Aug 22, 2008 7:43 pm

Regex for all url

Post by killerdedieu » Wed Mar 04, 2009 4:31 pm

Hi,

someone can help me to make and explain me the regex for block all the url

http://[...].[...] <== example : http://unrealircd.com
http://[...].[...]/[...] <== example : http://unrealircd.com/filename.ext or http://unrealircd.com/directory
http://www.[...].[...] <== example : http://www.unrealircd.com
http://www.[...].[...]/[...] <== example : http://www.unrealircd.com/filename.ext or http://www.unrealircd.com/directory
www.[...].[...] <== example : www.unrealircd.com
www.[...].[...]/[...] <== example : www.unrealircd.com/filename.ext or www.unrealircd.com/directory
[...].[...] <== example : unrealircd.com unrealird.fr unrealircd.org unrealircd.ca unrealircd.net unrealircd.biz (the .ext is major here...)

Thx!

frozenfire
Posts: 4
Joined: Fri Sep 25, 2009 8:38 pm

Re: Regex for all url

Post by frozenfire » Fri Sep 25, 2009 9:09 pm

(http://)?[A-Za-z0-9\-.]+\.[a-z]+(/[^ ])*

Jobe1986
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Regex for all url

Post by Jobe1986 » Sat Sep 26, 2009 2:23 pm

frozenfire wrote:(http://)?[A-Za-z0-9\-.]+\.[a-z]+(/[^ ])*
"whoops I missed a space.Now this message will trigger a spamfilter."

Just a tip, TRE regular expressions in UnrealIRCd are case insensitive by default so [A-Za-z] and [a-z] and [A-Z] are all the same UNLESS you force the regex into case sensitive mode.

As for the original post, it's very tricky to block what ahs been requested with a regex without a HIGH percentage of false positives.
Your IP: Image
Your Country: Image

Post Reply