Ansicht
Dokumentation
ABENMATCHES_FUNCTIONS - MATCHES FUNCTIONS
SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up PERFORM Short ReferenceThis documentation is copyright by SAP AG.
- 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.
- If the argument pcre is used, regex must contain a PCRE regular expression.
- If the argument xpath is used, regex must contain a XPath regular expression.
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.
- Besides pcre and xpath, the obsolete argument regex can also be used. Then an obsolete POSIX regular expression must be passed.
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.
Exceptions
Catchable Exceptions
- Cause: Illegal offset or length specified in off and len.
Runtime Error: STRING_OFFSET_TOO_LARGE
- Cause: See Exceptions in Regular Expressions.
Runtime Error: REGEX_TOO_COMPLEX
- 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 )