diff --git a/lib/irc.js b/lib/irc.js index 8a0eda7..abba9f5 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -264,7 +264,7 @@ const alphaNum = (() => { return new RegExp(/^[a-zA-Z0-9]$/, "u"); } })(); -const space = new RegExp(/\s/); +const space = new RegExp(/^\s$/); function isWordBoundary(ch) { switch (ch) { @@ -279,7 +279,7 @@ function isWordBoundary(ch) { function isURIPrefix(text) { for (let i = text.length - 1; i >= 0; i--) { - if (text[i].search(space)) { + if (space.test(text[i])) { text = text.slice(i); break; }