markush.eu

August 18, 2019 - Written by markus

#Das ist eine Überschrift

    DATA:  REGEX   TYPE REF TO cl_abap_regex,       " Regex Object
           matcher TYPE REF TO cl_abap_matcher,     " Matcher Object
           value_to_check TYPE STRING.
    *
    value_to_check = '12345677'.
     
    * Instntiate Regex
    CREATE OBJECT REGEX
      EXPORTING
        pattern     = '[A-Z]'
        ignore_case = abap_true.
     
    * Create the Matcher
    matcher = regex->create_matcher( text =  value_to_check ).
     
    * Match not found, invalid
    IF matcher->match( ) = 'X'.
      WRITE: 'Its a match'.
    ELSE.
      WRITE: 'Not a match'.
    ENDIF.

Schaut doch auf git.markush.eu