βš™οΈSAPTools
πŸ”€

ABAP Regex Tester

ABAPNew

Test regular expressions in ABAP flavor using FIND/REPLACE with REGEX syntax. Preview matches, test PCRE patterns, and generate ready-to-use ABAP code.

/
/
g = global Β· i = case-insensitive Β· m = multiline Β· s = dotall

Highlighted Matches2 matches

Contact us at support@sapdevtools.com or admin@example.com

Match List

1support@sapdevtools.com
2admin@example.com

FIND Statement

FIND ALL OCCURRENCES OF REGEX '[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}'
  IN lv_text
  RESULTS DATA(lt_results).
IF sy-subrc = 0.
  " Matches found: process lt_results
ENDIF.

REPLACE Statement

REPLACE ALL OCCURRENCES OF REGEX '[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}'
  IN lv_text
  WITH '<replacement>'.

Advertisement

About ABAP Regex Tester

ABAP's FIND/REPLACE with REGEX uses PCRE syntax, but testing a pattern normally means running it inside the debugger against real data β€” slow feedback for iterating on a regex. This tester lets you try a pattern against sample text and see matches highlighted instantly, then gives you the equivalent ABAP FIND/REPLACE statement to paste into your code.

How to use this tool

  1. Enter your regex pattern and sample text to test it against.
  2. See matches highlighted in real time as you adjust the pattern.
  3. Toggle case-sensitivity and other PCRE flags to match ABAP's regex behavior.
  4. Copy the generated FIND ALL OCCURRENCES OF REGEX ... or REPLACE ... statement into your code.

All processing happens locally in your browser. No data is sent to any server. Your SAP code and business data remain private at all times.

Frequently Asked Questions

Does ABAP use standard PCRE regex syntax?

ABAP supports PCRE (Perl-Compatible Regular Expressions) in FIND/REPLACE statements and in the CL_ABAP_REGEX class. Most standard PCRE syntax works, but some features like lookahead/lookbehind may behave differently. Test your patterns here before using them in production.

How do I use regex in ABAP code?

Use FIND REGEX pattern IN string. For replacements: REPLACE ALL OCCURRENCES OF REGEX pattern IN string WITH replacement. For programmatic use, CL_ABAP_REGEX and CL_ABAP_MATCHER provide an object-oriented interface with named groups and submatches.

What is the difference between FIND REGEX and FIND with wildcard?

FIND with wildcard (* and ?) uses simple glob-style matching (limited). FIND REGEX uses the full PCRE engine, supporting character classes, quantifiers, groups, and anchors. Always use REGEX for complex pattern matching.