SAP REGEX MIGRATING POSIX



Get Example source ABAP code based on a different SAP table
  


VERSION 5 IN

ABAP_REGEX - Migrating from POSIX to PCRE
The ABAP Kernel of an AS ABAP implements two libraries for regular expressions:
The PCRE2 library for PCRE regular expressions .
Version 1.31 of the <(>Boost.Regex Library<)> for POSIX regular expressions (obsolete).
Regular expressions in POSIX syntax are obsolete. Using regular expressions in POSIX syntax leads to a warning from syntax check that can be hidden by the pragma ##regex_posix. Therefore, it is recommended that regular expressions are migrated from POSIX to PCRE syntax or another regular expression syntax supported by ABAP.
The following table provides a general troubleshooting for migrating from POSIX to PCRE: SymptomPossible Solutions
The PCRE library rejects the pattern (e.g. by giving a compiler error or raising an exception)Make sure to not use any features that are supported by POSIX but not by PCRE. Also pay close attention to the error message, which often contains useful information.
The pattern does not match what it should after migrating to PCREMake sure that you have taken PCRE's extended mode into account by either explicitly encoding whitespaces or by disabling extended mode. Ensure that you have set the correct Unicode handling for your context.
The following topics provide detailed assistance for the migration from POSIX to PCRE.
Incompatibilities between POSIX and PCRE
New features in PCRE compared to POSIX