[CLJS-776] re-matches is incorrect Created: 28/Feb/14 Updated: 24/Jun/14
The re-matches function does not have the correct semantics: it performs a search (not match) against the string and returns nil if the string and matched-string are unequal. This is not the same as true matching, which is like inserting "^" and "$" at the beginning and end of the pattern.
Example in Clojure:
This bug is (one of the) reasons why
I'm not completely sure what to do here. My first thought is to have re-matches inspect the -source property of its regex input, wrap the string with "^$", then carefully copy all flags over to a new regexp.
|Comment by Francis Avila [ 24/Jun/14 7:37 AM ]|
I would like to propose a somewhat radical suggestion that would: fix this issue and
Example implementation (not a patch) at this cljsfiddle: http://cljsfiddle.net/fiddle/favila.regexp