当前位置:网站首页>Parse the value of uuid using ABAP regular expressions
Parse the value of uuid using ABAP regular expressions
2022-08-10 15:32:00 【Wang Zixi】
What the following code does is,使用 ABAP 正则表达式,将 uuid = The following specific values are parsed out:
REPORT z.
data: lv type string value 'uuid=dd&sid=0.7795630486081988'.
DATA: moff TYPE i,
mlen TYPE i.
FIND REGEX '^uuid=(.*)&.*$' IN lv
MATCH OFFSET moff
MATCH LENGTH mlen.
WRITE: / sy-subrc.
WRITE:/ moff, mlen.
WRITE:/ lv+moff(mlen).
DATA(reg_pattern) = '^uuid=(.*)&.*$'.
DATA(lo_regex) = NEW cl_abap_regex( pattern = reg_pattern ).
DATA(lo_matcher) = lo_regex->create_matcher( EXPORTING text = lv ).
CHECK lo_matcher->match( ) = abap_true.
DATA(lt_reg_match_result) = lo_matcher->find_all( ).
READ TABLE lt_reg_match_result ASSIGNING FIELD-SYMBOL(<reg_entry>) INDEX 1.
data(match) = lt_reg_match_result[ 1 ].
data(submatch) = match-submatches[ 1 ].
WRITE:/ 'uuid:', lv+submatch-offset(submatch-length).
边栏推荐
猜你喜欢
随机推荐
SWIG Tutorial "One"
解题-->在线OJ(十九)
Redis -- Nosql
Rich Dad Poor Dad Reading Notes
storage of data in memory
全部内置函数详细认识(中篇)
Flask框架——MongoEngine使用MongoDB数据库
$'\r': command not found
自定义picker滚动选择器样式
SWIG教程《四》-go语言的封装
Understanding_Data_Types_in_Go
【吴恩达来信】强化学习的发展!
格式化输出当前时间
“蔚来杯“2022牛客暑期多校训练营7
pm2之静态文件服务
SWIG tutorial "four" - package of go language
第壹章模块大全之《re模块》
Introduction to the Internet (2)
兆骑科创高层次人才创业大赛平台,投融资对接,双创服务
12海里、24海里、200海里的意义及名称