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

RegexTool#find() returns the capturing groups for only the first match

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.4-milestone-2
    • 7.4-milestone-1
    • Velocity
    • None
    • Unit

    Description

      The following shows the problem:

      {{velocity}}
      #set ($statement = 'one :two three (:four) five :six seven=:eight')
      #foreach ($item in $regextool.find($statement, ':(\w+)'))
        * $item.getGroup() , $item.getStart() , $item.getEnd()
      #end
      {{/velocity}}
      

      The output is:

      * :two , 4 , 8
      * two , 5 , 8
      

      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: