It seems that .test mutates the regular expression, whereas .match does
not. Whoo JavaScript!
This commit is contained in:
Evan Czaplicki 2014-03-16 14:09:25 -07:00
parent 154187c8f6
commit 3b3ee156f2

View file

@ -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) {