我想使用正则表达式从此字符串中的denomamount中提取游戏标题中的Wild%20Wolf
和50
。
我的产品支持“POSIX扩展常规语法(ERE)”和“Perl反斜杠序列”。
提前致谢!
(denomamount =)*&安培?;得到像
一样的东西“denomamount = 50&安培; showInitialCashier =假安培; denomid = 3311&安培; minbet = 50&安培; parametersFromConfigCall =真安培; nscode = DDI&安培; securetoken = dummyToken&安培; xtautopull”
....
“/ TC /播放&安培; COUNTRYCODE = US&安培; skincode = DDI-SKIN1&安培; istournament =假安培; terminalid =安培; gametitle = 野生%20Wolf &安培; buildnumber = R370.D1.0 .F.CL79775_244&安培;音频= ON&安培; UNIQUEID = 11906989&安培; defaultbuyinamount = 1000.0&安培; denomamount = 50 &安培; showInitialCashier =假安培; denomid = 3311&安培; minbet = 50&安培; parametersFromConfigCall =真安培; nscode = DDI&安培; securetoken = dummyToken&安培; xtautopull“
答案 0 :(得分:0)
通过使用Basic正则表达式(BRE)的sed,
$ sed 's/.*gametitle=\([^&]*\).*denomamount=\([^&]*\).*/\1\n\2/g' file
Wild%20Wolf
50