Chapter 4. Regular Expressions

In this chapter, we will see recipes related to regular expressions as used in ABAP. We will look at:

  • Using regex as an IF statement
  • Removal of characters from a string
  • Converting date into internal date type
  • Validation of format (telephone number)
  • Removing repeated words from text string
  • Inserting commas in an amount string
  • Removing comments from program code
  • Interpreting HTML stream

Introduction

As of release 7.0, ABAP supports regular expressions based on POSIX standard 1003.2. Regular expressions may be specified after the addition REGEX within the FIND and REPLACE statements.

An entire description of the topic constitutes a book by itself. However, the most important and commonly used regular expressions requirements will ...

Get SAP ABAP Advanced Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.