Skip to Content
1
Former Member
Jan 28, 2014 at 11:42 AM

ABAP REGEX Question

47 Views

Hi everybody,

I got a string like:

data: mystring type string value 'DE11111X1111DE222222222222222ZPDE33333333333333DE44444444444'.


How can I find the string from the first <DE> to the second <DE> (= DE11111X1111) ?


I tried


data: mystring type string value 'DE1111X11111DE222222222222222ZPDE33333333333333DE44444444444'.
DATA: moff TYPE i,
mlen TYPE i.

FIND REGEX 'DE.*DE' IN mystring MATCH COUNT sy-tabix
MATCH OFFSET moff
MATCH LENGTH mlen.
write:/ mystring+moff(mlen).

But this gives:

DE1111X11111DE222222222222222ZPDE33333333333333DE

Thanks, Regards

Mario