gdamjan / erlang-irc-bot

A simple extendable irc bot in Erlang
http://github.com/gdamjan/erlang-irc-bot/wiki
MIT License
80 stars 25 forks source link

better regex for grabing urls in the title plugin #2

Closed gdamjan closed 14 years ago

gdamjan commented 14 years ago

The current regex "\b((http://|www\.)[\S]*)\b" doesn't grab the last slash from url's. A better regex is needed.

run re:run("www.google.com/abc/", "\b((http://|www\.)[\S]*)\b", [caseless, {capture, [1], binary}]). in the "erl" repl to see/test the problem.

gdamjan commented 14 years ago

Commit: 59cee0e95ab27dbb1828b0dfacd4450b1f79ed33 has a good enough sollution to this