当前位置:网站首页>使用 ABAP 正则表达式解析 uuid 的值
使用 ABAP 正则表达式解析 uuid 的值
2022-08-10 14:59:00 【汪子熙】
下列这段代码的作用是,使用 ABAP 正则表达式,将 uuid = 后面的具体值解析出来:
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).
边栏推荐
- Redis -- Nosql
- 领域驱动模型设计与微服务架构落地-从项目去剖析领域驱动
- SWIG Tutorial "One"
- It is reported that the original Meitu executive joined Weilai mobile phone, the top product may exceed 7,000 yuan
- 推荐几款最好用的MySQL开源客户端,建议收藏!
- 老板加薪!看我做的WPF Loading!!!
- Websocket realizes real-time change of chart content
- PyTorch multi-machine multi-card training: DDP combat and skills
- Yann LeCun转推:参数减少50倍,性能还更好,MetaAI推出Atlas信息检索模型
- SWIG教程《一》
猜你喜欢
PyTorch 多机多卡训练:DDP 实战与技巧
Analysys and the Alliance of Small and Medium Banks jointly released the Hainan Digital Economy Index, so stay tuned!
storage of data in memory
DB2查询2个时间段之间的所有月份,DB2查询2个时间段之间的所有日期
metaForce佛萨奇2.0系统开发功能逻辑介绍
Appium进行APP自动化测试
Based on Azuki Series: NFT Valuation Analysis Framework "DRIC"
12海里、24海里、200海里的意义及名称
TCP为什么是三次握手和四次挥手?
使用Uiautomator2进行APP自动化测试
随机推荐
网络安全(加密技术、数字签名、证书)
CSP-J1 CSP-S1 初赛 第1轮(2022.08.09)
PyTorch 多机多卡训练:DDP 实战与技巧
LeetCode_2598_剑指Offer Ⅱ 091.粉刷房子
Data Types and Integer Storage
一文让你快速了解大小端概念!
“国资云”和“国家云”能给市场带来怎样的变革?
640. 求解方程 : 简单模拟题
王学岗————直播推流(软便)03x264集成与camera推流
[Letter from Wu Enda] The development of reinforcement learning!
pm2之静态文件服务
systemui shield notification bar
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 7
小程序-语音播报功能
TestLink Export Use Case Transformation Tool
匿名函数和全部内置函数详细认识(下篇)
Boss raises salary!Look at my WPF Loading!!!
pytest框架优化
Zhaoqi Technology Innovation High-level Talent Entrepreneurship Competition Platform
WSL 提示音关闭