diff options
author | Dom Rodriguez <shymega@shymega.org.uk> | 2017-04-20 17:49:12 +0200 |
---|---|---|
committer | Dom Rodriguez <shymega@shymega.org.uk> | 2017-04-20 17:49:12 +0200 |
commit | be953b698b10d546a4fc1c4c3e4e8233bccfc4c9 (patch) | |
tree | 0d79e227dcf4330c97f63bde2c71b899444119bf /lib/exirc/utils.ex | |
parent | Fix IRC regex handling of slashes in host (diff) |
Tweak regex to be more efficient
Diffstat (limited to 'lib/exirc/utils.ex')
-rw-r--r-- | lib/exirc/utils.ex | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/exirc/utils.ex b/lib/exirc/utils.ex index e9c0c35..8d4d3f1 100644 --- a/lib/exirc/utils.ex +++ b/lib/exirc/utils.ex @@ -25,7 +25,7 @@ defmodule ExIrc.Utils do end end - @prefix_pattern ~r/^(?<nick>[^!]+)(?:!(?:(?<user>[^@ ]+)@)?(?:(?<host>\S+[\w.:-]+)))?$/ + @prefix_pattern ~r/^(?<nick>[^!\s]+)(?:!(?<user>[^@\s]+@)?(?<host>\S+))?$/ defp parse_from(from, msg) do from_str = IO.iodata_to_binary(from) parts = Regex.run(@prefix_pattern, from_str, capture: :all_but_first) |