Skip to Content
0
Former Member
Aug 29, 2007 at 06:02 PM

Regular expression confusion

29 Views

Hello all,

I'm a long time unix geek who's trying to make sense of regular expressions in ABAP. Look at this little program. If I run it as shown, it's successful.

If I use "Gzzxx" , it's not.

Can anyone explain this. That would be a perfectly valid string in any other tool I've used that supports regular expressions, whether that be a unix shell, perl, awk, or ruby.

REPORT zebj_hack5.
PARAMETERS:
  p_input TYPE string DEFAULT 'xxxxGGGGzzzzxxxxGGGGzzzz' LOWER CASE,
  p_regex TYPE string DEFAULT 'Gz' LOWER CASE,
  p_all as checkbox.

START-OF-SELECTION.
  FIND FIRST OCCURRENCE OF p_regex IN p_input.
    IF sy-subrc = 0 .
      WRITE:/ p_regex, ' found in ', p_input.
    ELSE.
      WRITE:/ p_regex , ' not found'.
    ENDIF.