Uploaded image for project: 'ClojureScript'
  1. CLJS-485

clojure.string/replace ignores regex flags

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: 1.7.145
    • Fix versions: 1.9.655
    • Labels:
      None
    • 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".

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alex+import import
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: