Ansicht
Dokumentation

ABENMATCH_FUNCTIONS - MATCH FUNCTIONS

ABENMATCH_FUNCTIONS - MATCH FUNCTIONS

ABAP Short Reference   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

- match

The match function returns a substring of a character-like argument that matches a regular expression.

... match( val = text pcre$|xpath = regex $[ case = case$] $[occ = occ$] ) ...

Effect

The built-in function match searches text for the match specified in occ with the regular expression specified in regex and returns the substring found. The search is case-sensitive by default, but this can be overridden using the parameter case.

A regular expression in PCRE or XPath syntax is compiled in an extended mode: Most unescaped whitespace (blanks and line breaks) of the pattern are ignored outside character classes and comments can be placed behind #. In order to specify whitespace and # characters in a pattern, they must be escaped or the extended mode must be switched of with (?-x) in the regular expression.

The return value has the type string.

Note

Besides pcre and xpath, the obsolete argument regex can also be used. Then an obsolete POSIX regular expression must be passed.

Example

The following match function returns x2.

String Functions, count, find and match

Exceptions

Catchable Exceptions

CX_SY_REGEX_TOO_COMPLEX

CX_SY_STRG_PAR_VAL

  • Cause: Regular expression in regex is empty or there are 0 occurrences in occ.
    Runtime Error: STRG_ILLEGAL_PAR





CPI1466 during Backup   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 3885 Date: 20240329 Time: 121020     sap01-206 ( 53 ms )