2015-11-18 06:14:39 +00:00
|
|
|
DATA: text TYPE string VALUE 'This is a Test'.
|
|
|
|
|
|
|
|
|
|
FIND FIRST OCCURRENCE OF REGEX 'is' IN text.
|
|
|
|
|
IF sy-subrc = 0.
|
|
|
|
|
cl_demo_output=>write( 'Regex matched' ).
|
|
|
|
|
ENDIF.
|
|
|
|
|
|
|
|
|
|
REPLACE ALL OCCURRENCES OF REGEX '[t|T]est' IN text WITH 'Regex'.
|
|
|
|
|
|
|
|
|
|
cl_demo_output=>write( text ).
|
2017-09-23 10:01:46 +02:00
|
|
|
cl_demo_output=>display( ).
|