Skip to main content
Skip table of contents

More details on Regular Expressions processing

Regular expression processing in ASTER, as implemented in Int4 Suite, is based on the POSIX-compatible regular expression solutions as provided by the ABAP platform in versions 7.40 and beyond. Due to compatibility reasons, support of the newer PCRE syntax is not available.

There are various manuals available for regular expressions. For complete reference of the actual solution, read more in SAP Help documentation pages: https://help.sap.com/doc/abapdocu_740_index_htm/7.40/en-US/abenregex_search.htm

Although POSIX implementation does not support non-greedy behaviour of + and * operators, ASTER attempts to overcome this limitation at the cost of some additional processing. One can request non-greedy behaviour by specifying the U option parameter.

Please note that this un-greedy solution is not equal to how PCRE and other regular expression processing engines implement non-greedy operators and might work differently. The results obtained by specifying the U option may be different from their PCRE *? or +? counterparts.

Worth noticing that specific results in the un-greedy mode are likely to appear when regular expressions contain boundary-like matching (e.g. word boundary \b or end-of-line boundary $).

Result table

Regular expressions provide significant amounts of data after execution.

Data element

Match

Match Data

Submatch

Submatch Data

Reference in code

V[x]

V[x][y]

V[x][“SUB”][z]

V[x][“SUB”][z][a]

Example

V[1]

V[1][“STR”]

V[1][“SUB”][2]

V[1][“SUB”][1][“STR”]

Match and submatch data lists contain the following information

Index

Meaning

Example

“OFF”

Offset of match or submatch from the start of string, zero-based.

CODE
# This will match CDEF and CDEFG
# with subgroups DEF and DEFG
V=CREGEX("C([^ABC]+)","ABCDEFABCDEFG","G");

# V[1]["OFF"] == 2
# V[1]["SUB"][1]["OFF"] == 3

“LEN”

Length of the match or submatch

CODE
# This will match CDEF and CDEFG
# with subgroups DEF and DEFG
V=CREGEX("C([^ABC]+)","ABCDEFABCDEFG","G");

# V[1]["LEN"] == 4
# V[2]["SUB"][1]["LEN"] == 4

“STR”

The actual match string or subgroup string

CODE
# This will match CDEF and CDEFG
# with subgroups DEF and DEFG
V=CREGEX("C([^ABC]+)","ABCDEFABCDEFG","G");

# V[1]["STR"] $== "CDEF"
# V[1]["SUB"][1]["STR"] $== "DEF"
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.