From 3b3ee156f2b0e23afd19ea7afd2dda965c9333cb Mon Sep 17 00:00:00 2001 From: Evan Czaplicki Date: Sun, 16 Mar 2014 14:09:25 -0700 Subject: [PATCH] Fix #524 It seems that .test mutates the regular expression, whereas .match does not. Whoo JavaScript! --- libraries/Native/Regex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Native/Regex.js b/libraries/Native/Regex.js index 5101a08..847c0fd 100644 --- a/libraries/Native/Regex.js +++ b/libraries/Native/Regex.js @@ -20,7 +20,7 @@ Elm.Native.Regex.make = function(elm) { } function contains(re, string) { - return re.test(JS.fromString(string)); + return JS.fromString(string).match(re) !== null; } function find(n, re, str) {