Ansicht
Dokumentation

ABENREGULAR_EXPRESSIONS - REGULAR EXPRESSIONS

ABENREGULAR_EXPRESSIONS - REGULAR EXPRESSIONS

TXBHW - Original Tax Base Amount in Local Currency   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

Regular Expressions ()

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:

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.

Notes

  • The test and demonstration program DEMO_REGEX makes it possible to test the search and replace functionality by applying regular expressions to texts.





CL_GUI_FRONTEND_SERVICES - Frontend Services   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 5924 Date: 20240424 Time: 215107     sap01-206 ( 112 ms )