The REPLACE statement can work with regular expressions directly:
DATA(lv_test) = 'The quick brown fox'.
REPLACE ALL OCCURRENCES OF REGEX '\wo' IN lv_test WITH 'XX'.
The variable lv_test will evaluate to The quick bXXwn XXx.
The quick bXXwn XXx
Get monthly updates about new articles, cheatsheets, and tricks.