Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-1014

Extend RegexTool with a method to quote the replacement string in String#replaceAll()

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.2-milestone-2
    • Fix Version/s: 8.2-rc-1
    • Component/s: Velocity
    • Labels:
      None
    • Tests:
      Unit
    • Similar issues:

      Description

      We have a method to quote the pattern:

      $regextool.quote($stringLiteral)
      

      We need a method to quote the replacement string:

      #set ($out = $out.replaceAll(" (id|for)=('|"")$regextool.quote($oldId)",
        " ${escapetool.d}1=${escapetool.d}2$regextool.quoteReplacement($newId)"))
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mflorea Marius Dumitru Florea
                Reporter:
                mflorea Marius Dumitru Florea
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: