Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regex Submatch is not getting populated

Former Member
0 Kudos

Hi ,

I am facing issue in getting the submatch value populated when I am using the below syntax

FIND REGEX '/REMI/.*/EREF/ IN 'hi 1234 /REMI/ asfcgcf 56789 /EREF/

RESPECTING CASE

MATCH OFFSET lv_offset

MATCH length lv_length

submatches cv_sub1.

My requirement is to get the text between /REMi/ and /EREF/. The patten which I gave is returning sy-subrc as 0 but

cv_sub1 which is submatch is blank.

Please provide your solutions on this.

Thank you.

Regards,

Mahalakshmi.

2 REPLIES 2

Former Member
0 Kudos

You're forgetting to indicate that you want to capture that bit:

'/REMI/(.*)/EREF/'

Notice the opening and closing brackets ( and ) around .*

yogendra_bhaskar
Contributor
0 Kudos

Hi Bulusu ,

Try this :

FIND REGEX '/REMI/(.*)/EREF/' IN 'hi 1234 /REMI/ asfcgcf 56789 /EREF/'

RESPECTING CASE

MATCH OFFSET lv_offset

MATCH length lv_length

submatches cv_sub1.