Get Example source ABAP code based on a different SAP table
VERSION 5 IN
Regular Expressions ( ABAP_REGEX ) A regular expression r> is made up of literal characters and special characters in accordance with the syntax of regular expressions> and represents a set of character strings. If text> is one of the character strings represented by r>, it means that r> matches text> or that r> fits text >. Two different regular expressions are the same if they match the same set of character strings. ABAP supports the following kinds of extended regular expressions>:
Perl Compatible Regular Expressions (PCRE)> in PCRE syntax>
XPath regular expressions> in XPath syntax>
XSD regular expressions> in XSD syntax>
POSIX regular expressions> in POSIX syntax> (obsolete) For Perl and POSIX regular expressions, respective libraries are implemented in ABAP Kernel>:
The PCRE2 library> is implemented for PCRE regular expressions.
Version 1.31 of the <(>Boost.Regex Library<)>> is implemented for POSIX regular expressions (obsolete). XPath and XSD regular expressions are internally converted into Perl syntax by the ABAP runtime framework. Regular expressions can be used for searching, replacing and matching> character strings. To do so, regular expressions can be specified in statements and built-in functions for character string processing:
For all kinds of regular expressions, objects of system class CL_ABAP_REGEX>> can be created. Those objects can be used with the addition REGEX>> of the statements FIND>> and REPLACE>> and with the system class CL_ABAP_MATCHER>>.
The following language elements address specific regular expressions:
For PCRE regular expressions, the addition PCRE>> can be used in the statements FIND> > and REPLACE>>. The argument pcre>> can be used in built-in functions for strings.
For XPath regular expressions, the argument xpath>> can be used in some built-in functions for strings.
For POSIX regular expressions, the addition REGEX> can be used in obsolete variants of the statements FIND> and REPLACE>> and the obsolete argument regex> > can be used in built-in functions for strings.