Report zz_test.
data : lv_str type string value 'Log Attributes 0.5 ( 0) ( 43.56 % Available )'.
data : lv_str_tmp type string.
data : lv_num1 type string,
lv_num2 type string,lv_num3 type string. data : lv_len type i. data: result_tab type match_result_tab. data : wa_result like line of result_tab. lv_str_tmp = lv_str. find all occurrences of regex '(\s\d+.\d*)' in lv_str_tmp resultsresult_tab. loop at result_tab into wa_result from 1 to 3. case sy-tabix. when 1. lv_num1 =lv_str_tmp+wa_result-offset(wa_result-length). write:lv_num1. when 2. lv_num2 =lv_str_tmp+wa_result-offset(wa_result-length). write:lv_num2. when 3. lv_num3 =lv_str_tmp+wa_result-offset(wa_result-length). write:lv_num3. endcase. endloop.
原文链接:https://www.f2er.com/regex/362419.html