summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDom Rodriguez <shymega@shymega.org.uk>2017-04-20 22:21:49 +0200
committerDom Rodriguez <shymega@shymega.org.uk>2017-04-20 22:21:49 +0200
commit960b396bc3f5f897a49ddc70496b8b9b22537066 (patch)
tree369502aa6ec295d29bcb0b6d547362efe39fb6e7
parentTweak regex to be more efficient (diff)
Tweak regex to work with tests
This latest patch **should** be the final patch for this PR, and as suggested by @bitwalker this patch fixes the test failure *as well*.
-rw-r--r--lib/exirc/utils.ex2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/exirc/utils.ex b/lib/exirc/utils.ex
index 8d4d3f1..2573cc3 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>[^!\s]+)(?:!(?<user>[^@\s]+@)?(?<host>\S+))?$/
+ @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)