Fix #524
It seems that .test mutates the regular expression, whereas .match does
not. Whoo JavaScript!
commit3b3ee156f2b0e23afd19ea7afd2dda965c9333cb
authorEvan Czaplicki <info@elm-lang.org>
dateSun 16 Mar 2014, 14:09 (13 years ago)
parent154187c
libraries/Native/Regex.js+1−1
@@ -20,7 +20,7 @@ Elm.Native.Regex.make = function(elm) {
2020 }
2121
2222 function contains(re, string) {
23− return re.test(JS.fromString(string));
23+ return JS.fromString(string).match(re) !== null;
2424 }
2525
2626 function find(n, re, str) {