当前位置:网站首页>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).
边栏推荐
猜你喜欢

fatal error C1083 无法打开包括文件'io.h' No such file

产品使用说明书小程序开发制作说明

E. Cross Swapping (and check out deformation/good questions)

一个 ABAP Development Tool 自定义 service endpoint 的测试工具

Mysql statement analysis, storage engine, index optimization, etc.

Appium for APP automation testing

网络安全(加密技术、数字签名、证书)

APP automation testing with Uiautomator2

storage of data in memory

秒杀项目收获
随机推荐
Appium进行APP自动化测试
【数仓设计】企业数仓为什么要进行分层?(六大好处)
格式化输出当前时间
【教程】HuggingFace的Optimum组件已支持加速Graphcore和英特尔Habana芯片
线上线下课程教学培训小程序开发制作功能介绍
网络安全(加密技术、数字签名、证书)
匿名函数和全部内置函数详细认识(下篇)
解题-->在线OJ(十九)
【MindSpore易点通机器人-02】设计与技术选型
Redis -- Nosql
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 7
DB2查询2个时间段之间的所有月份,DB2查询2个时间段之间的所有日期
自定义picker滚动选择器样式
秒杀项目收获
基于inotify实现落盘文件的跨进程实时读写交互
How to code like a pro in 2022 and avoid If-Else
MySQL批量更新与批量更新多条记录的不同值实现方法
易观千帆银行用户体验中心:聚焦银行APP用户体验
Yann LeCun转推:参数减少50倍,性能还更好,MetaAI推出Atlas信息检索模型
fatal error C1083 Unable to open include file 'io.h' No such file