我一直在嘗試從回應標頭中提取值。我嘗試使用 RegEx 和邊界提取器,但我無法成功。并且該請求總是給出302回應代碼。
我的回應標題:
HTTP/1.1 302
server: nginx
date: Wed, 23 Feb 2022 12:35:19 GMT
content-length: 0
x-frame-options: SAMEORIGIN
cache-control: no-cache, no-store, max-age=0, must-revalidate
pragma: no-cache
expires: 0
strict-transport-security: max-age=31536000 ; includeSubDomains
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
location: https://somedomainname.com/tr/checkout/orderConfirmation/2202231535500
content-language: tr
connection: close
我要提取的是訂單確認號: 2202231535500 ,它將在測驗期間作為動態值出現。
uj5u.com熱心網友回復:
采用
orderConfirmation/([0-9] )
請參閱正則運算式證明。
解釋
--------------------------------------------------------------------------------
orderConfirmation/ 'orderConfirmation/'
--------------------------------------------------------------------------------
( group and capture to \1:
--------------------------------------------------------------------------------
[0-9] any character of: '0' to '9' (1 or more
times (matching the most amount
possible))
--------------------------------------------------------------------------------
) end of \1
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/432364.html
上一篇:URL字串的正則運算式部分
下一篇:sed命令不適用于正則運算式
