2022.2

Table Of Contents
they allow the use of regular expressions.
Using regular expressions, it is possible to search for patterns rather than specific strings. For instance,
a pattern can be specified to find all valid email addresses or phone numbers within the data stream.
In a regular expression, substrings can be captured as groups using parentheses. Values of capturing
groups - the matched substrings - can then be included in the replacement string using the dollar sign
syntax: $1 ... $9. The numbering follows the order in which groups appear in the search string.
For example, in order to replace all instances of "Page x/y" (Page 1/3, Page 2/3, etc.) in a document
with "Page x of y total pages", the regular expression would have to contain parentheses to capture the
values of x and y: Page\s(\d*)\/(\d*). The first capturing group, (\d*), contains the value of x, the
second the value of y.
The replacement string would then be: Page $1 of $2 total pages (where $1 contains x, and $2
contains y).
For more information about regular expressions, visit a website like https://www.regular-expres-
sions.info/.
To test out your regular expressions go to: https://regex101.com/.
Input
Any text-based file can be used in this task, even formats that are not directly compatible with PReS
Workflow. As long as the text is visible in a text-based editor (such as Notepad), it is readable and sup-
ported by this task.
Processing
The appropriate changes are made to the data file (replacing text).
Output
The modified data file is output from this task. Metadata is not modified in any way if it is present.
Task properties
General tab
l
Search mode group: Select your chosen search mode within this group.
l
Search line by line: Select if you want each line in the data stream to be searched sep-
arately. When this option is selected, PReS Workflow considers each line as an individual
data stream (lines are separated by Line Feed characters). It minimizes memory require-
ments but may also limit hits, since lines are considered separately. Note that it is not pos-
sible to use search expressions that specify multiple data lines when this option is
selected.
Page 353