Ansicht
Dokumentation

ABENMATCHES_FUNCTIONS - MATCHES FUNCTIONS

ABENMATCHES_FUNCTIONS - MATCHES FUNCTIONS

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- matches

... matches( val = text pcre$|xpath = regex $[case = case$]
             $[off = off$] $[len = len$] ) ...


Effect

The built-in predicate function matches compares a search range of the argument text, defined using off and len, with the regular expression specified in regex.

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 # in a pattern, they must be escaped or the extended mode must be switched of with (?-x) in the regular expression.

The function returns a truth value.

  • The return value is true when the whole search range matches the regular expression.
  • It is false else.

The comparison is case-sensitive by default, but this can be overridden using the parameter case.

Notes

  • The match function match can be used to return a substring that matches a regular expression.

The first predicate function returns the value "true" because the argument val only contains letters. The second predicate function returns the value "false" because the argument val also contains numbers.

Predicate Function, matches

Exceptions

Catchable Exceptions

CX_SY_RANGE_OUT_OF_BOUNDS

  • Cause: Illegal offset or length specified in off and len.
    Runtime Error: STRING_OFFSET_TOO_LARGE

CX_SY_REGEX_TOO_COMPLEX

CX_SY_STRG_PAR_VAL

  • Cause: Regular expression in regex is empty.
    Runtime Error: STRG_ILLEGAL_PAR





General Data in Customer Master   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 4965 Date: 20240424 Time: 231502     sap01-206 ( 52 ms )