regex 正则表达式(在特定行匹配整数)json

ni65a41a  于 2023-06-25  发布在  其他
关注(0)|答案(1)|浏览(66)
HTTP/1.1 200 
X-Application-Context: fss-proxy
Date: Tue, 03 Apr 2018 11:38:13 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE, PATCH
Access-Control-Allow-Headers: Authorization,Content-Type,If-Modified-Since,headers,If-Modified-Since
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: close

18

activeSessionsCount=1

0

我有JSON在这里。我只想在当前字符串“activeSessionsCount=1”中使用正则表达式获取从0到200甚至更多的整数。这可能吗?我完全被困在这里了。

thtygnil

thtygnil1#

这取决于你使用的正则表达式解析语言-函数和方法会有所不同。一般来说,它可以像/.*activeSessionsCount=(\d+)/gm一样简单

相关问题