Table of Contents

Search

  1. Preface
  2. Introduction to Data Transformation
  3. Data Processor Transformation
  4. Wizard Input and Output Formats
  5. Relational Input and Output
  6. XMap
  7. Libraries
  8. Schema Object
  9. Command Line Interface
  10. Scripts
  11. Parsers
  12. Script Ports
  13. Document Processors
  14. Formats
  15. Data Holders
  16. Anchors
  17. Transformers
  18. Actions
  19. Serializers
  20. Mappers
  21. Locators, Keys, and Indexing
  22. Streamers
  23. Validators, Notifications, and Failure Handling
  24. Validation Rules
  25. Custom Script Components

Data Transformation User Guide

Data Transformation User Guide

Preserving Portions of the Original Text

Preserving Portions of the Original Text

In the
exp
property, you can enclose portions of the regular expression in parentheses. In the
replacement
property, you can use:
  • $0
    to identify the entire text that matches the regular expression
  • $1
    to identify the substring that matches the first parenthesized portion of the regular expression
  • $2
    ,
    $3
    , and so forth, to identify the substrings that match the second, third, etc. parenthesized portions
For example, suppose you set:
exp = abc([0-9]+)(def) replacement = $1
This replaces
abc5624def
with
5624
.
Alternatively, suppose you set:
exp = abc([0-9]+)(def) replacement = $2ZYX$1
This replaces
abc5624def
with
defZYX5624
.


Updated September 26, 2018