2008 Oct 01 2:35 PM
Hi,
I have a string that contain/s &text&, text can be anything.
I want to extract all such text in the string.
How can i achieve this, please help
Regards,
piyush
2008 Oct 01 2:37 PM
Hello,
Example
: Search for all occurrences of the string "now" in a string literal. The offsets 11 and 24 of both found locations are displayed as output.
DATA: patt TYPE string VALUE `now`,
text TYPE string,
result_tab TYPE match_result_tab.
FIELD-SYMBOLS <match> LIKE LINE OF result_tab.
FIND ALL OCCURRENCES OF patt IN
`Everybody knows this is nowhere`
RESULTS result_tab.
LOOP AT result_tab ASSIGNING <match>.
WRITE: / <match>-offset, <match>-length.
ENDLOOP.
Regards.
2008 Oct 01 2:37 PM
Hello,
Example
: Search for all occurrences of the string "now" in a string literal. The offsets 11 and 24 of both found locations are displayed as output.
DATA: patt TYPE string VALUE `now`,
text TYPE string,
result_tab TYPE match_result_tab.
FIELD-SYMBOLS <match> LIKE LINE OF result_tab.
FIND ALL OCCURRENCES OF patt IN
`Everybody knows this is nowhere`
RESULTS result_tab.
LOOP AT result_tab ASSIGNING <match>.
WRITE: / <match>-offset, <match>-length.
ENDLOOP.
Regards.