<< Back to previous view

[CLJS-116] Make re-pattern accept modifiers too Created: 06/Jan/12  Updated: 27/Jul/13  Resolved: 05/Feb/12

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Edd Dumbill Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


Have a second optional argument to re-pattern that accepts modifier flags for the RegExp, being one or more of "i" "g" or "m". Otherwise it is impossible to programmatically construct modified regexes without using js/RegExp directly.

> #"(?i)foo"

> (re-pattern "(?i)foo")
"Error evaluating:" (re-pattern "(?i)foo") :as "cljs.core.re_pattern.call(null,\"(?i)foo\");\n"
#<SyntaxError: Invalid regular expression: /(?i)foo/: Invalid group>

Comment by David Nolen [ 05/Feb/12 1:39 PM ]

Fixed, https://github.com/clojure/clojurescript/commit/65a9d4fa91f195b5ef7c274b2d4ce8661848a2a6

Generated at Mon Apr 22 23:54:02 CDT 2019 using JIRA 4.4#649-r158309.