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()

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Major
    • 8.2-rc-1
    • 8.2-milestone-2
    • Velocity
    • None
    • Unit

    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

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

              Dates

                Created:
                Updated:
                Resolved: