Uploaded image for project: 'FreeSWITCH'
  1. FreeSWITCH
  2. FS-5566

RFE: Support ${N} syntax for regexp groups expansion

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: freeswitch-core
    • Labels:
      None
    • CPU Architecture:
      x86
    • Kernel:
      Linux
    • Userland:
      GNU/Linux
    • lsb_release:
      Hide
      LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
      Distributor ID: CentOS
      Description: CentOS release 6.4 (Final)
      Release: 6.4
      Codename: Final
      Show
      LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.4 (Final) Release: 6.4 Codename: Final
    • Compiler:
      gcc
    • FreeSWITCH GIT Revision:
      58e3680
    • GIT Master Revision hash::
      yes

      Description

      the actual expasion for matched groups in regexp follows the rule $1, $2 and so on for each group.

      This does not make possibile to concat a number after the group, for example:
      $112345 , where $1 is my first matched group.

      Obviously this can be ambiguos, since you may want group 1 or 112345 (even if groups are limited
      to 256), so the same or similar syntax used by bash or perl can be used:
      ${1}12345 => will do the trick

      some dialplan example:
      http://pastebin.freeswitch.org/21136

        Attachments

          Activity

            People

            • Assignee:
              anthm Anthony Minessale II
              Reporter:
              mbranca Matteo Brancaleoni
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: