Page 1 of 1

Regex for all url

Posted: Wed Mar 04, 2009 4:31 pm
by killerdedieu
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!

Re: Regex for all url

Posted: Fri Sep 25, 2009 9:09 pm
by frozenfire
(http://)?[A-Za-z0-9\-.]+\.[a-z]+(/[^ ])*

Re: Regex for all url

Posted: Sat Sep 26, 2009 2:23 pm
by Jobe
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.