ClojureScript

clojure.string/replace ignores regex flags

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.7.48
  • Fix Version/s: Next
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test

Description

The replace function in namespace clojure.string ignores regex flag provided in the match pattern. For example:

CLJS
clojure.string/replace "I am NOT matched" #"(?i)not " "")
=> "I am NOT matched"
CLJ
clojure.string/replace "I am NOT matched" #"(?i)not " "")
=> "I am matched"

The attached patch fixes this by parsing the m and i flags, if set, from the match object, instead of explicitly setting only "g".

Activity

David Nolen made changes -
Field Original Value New Value
Priority Major [ 3 ] Minor [ 4 ]
David Nolen made changes -
Affects Version/s 0.0-3115 [ 10352 ]
Fix Version/s Next [ 10355 ]
David Nolen made changes -
Fix Version/s Next [ 10355 ]
Fix Version/s Backlog [ 10356 ]
Affects Version/s 0.0-3115 [ 10352 ]
Affects Version/s Next [ 10355 ]
David Nolen made changes -
Fix Version/s Next [ 10356 ]
Fix Version/s Backlog [ 10362 ]
David Nolen made changes -
Fix Version/s Next [ 10362 ]
Fix Version/s Backlog [ 10363 ]
Affects Version/s 0.0-3196 [ 10355 ]
Affects Version/s Next [ 10362 ]
David Nolen made changes -
Fix Version/s Next [ 10363 ]
Fix Version/s Backlog [ 10365 ]
Affects Version/s 0.0-3255 [ 10362 ]
Affects Version/s Next [ 10363 ]
David Nolen made changes -
Fix Version/s Next [ 10365 ]
Fix Version/s Backlog [ 10366 ]
David Nolen made changes -
Fix Version/s 1.7.28 [ 10366 ]
Fix Version/s Next [ 10450 ]
Affects Version/s 0.0-3269 [ 10363 ]
Affects Version/s 1.7.28 [ 10366 ]
David Nolen made changes -
Fix Version/s Next [ 10450 ]
Fix Version/s Backlog [ 10651 ]
Affects Version/s 1.7.28 [ 10366 ]
Affects Version/s Next [ 10450 ]

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated: