The %%$PARSE function parses a specified string (that is, it splits the specified string into substrings) according to a specified template. A template consists of variables and "patterns" that determine the parsing process.
The format of the %%$PARSE function is
DO SET=%%$PARSE string template
In this format
Example
DO SET=%%S=THIS IS A SAMPLE STRING
DO SET=%%T=A1 A2 A3 A4 A5
DO SET=%%$PARSE %%S %%T
The %%$PARSE function assigns substrings of the specified string to the specified variables according to the specified template.
The DO SET statements in the above example provide the same result as the following DO SET statements:
DO SET=%%A1=THIS
DO SET=%%A2=IS
DO SET=%%A3=A
DO SET=%%A4=SAMPLE
DO SET=%%A5=STRING
The parsing process involves the following stages:
Template elements are
The rules of parsing are detailed in the following paragraphs.
Parent Topic |