SAP PRED FUNCTION MATCHES ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_RELEXP - Predicate Function matches
This example demonstrates the predicate function matches.

ABAP_SOURCE_CODE
DEMO CL_DEMO_MATCHES

ABAP_DESCRIPTION
The class checks the formal correctness of an entered e-mail address by comparing it with regular expressions.
The first regular expression checks for standard e-mail addresses without special characters, whereas the second regular expression performs a more lenient syntax check in accordance with RFC 822.
Even the second check, which uses a relatively simple regular expression for the example, is not always compatible with all e-mail addresses that would be possible in accordance with RFC 822.
The class CL_DEMO_VALIDATE_RFC_822_ADDR uses a regular expression taken from the Internet, which is designed to recognize all e-mail addresses allowed by RFC 822. The regular expression here was written originally for Perl and has more than 6000 characters. The class is therefore an example of how not to use regular expressions in ABAP.