Numeric patterns are numbers that mark positions in the string. They are used to break the original string into substrings at the position indicated by the number.
The position specified can be absolute or relative:
Example 1
A parsing template with an absolute numeric pattern:
DO SET=%%S =THIS IS A SAMPLE STRING
DO SET=%%T = A1 A2 11 A3 A4 A5
DO SET=%%$PARSE %%S %%T
As a result of parsing
A1=THIS
A2=IS A
As a result of parsing
A3=SAMPLE
A4=STRING
A5=NULL (0 length string)
Example 2
A parsing template with a relative numeric pattern:
DO SET=%%S =THIS IS A SAMPLE STRING
DO SET=%%T = A1 A2 +10 A3 A4 A5
DO SET=%%$PARSE %%S %%T
Last position is the beginning of the string (position 1).
Position marked within the string is 1 + 10 = 11.
As a result of parsing
A1=THIS
A2=IS A
As a result of parsing:
A3=SAMPLE
A4=STRING
A5=NULL (0 length string)
Parent Topic |