|
5精币
新手练习post,用正则取到了需要的匹配文本。问题是 其中一项网页源码里是实际数量的100倍,比如实际是1480,网页源码里是148000.
现在想求助大家,如何把这个匹配文本除以100,或者去掉2个0. (目标是:子匹配文本4)
正则表达式 transType":"(.*?)","custShortName":"(.*?)",[\s|\S]*?"posCati":"(.*?)",[\s|\S]*?"amount":"(.*?)",[\s|\S]*?"createTime":"(.*?)","summaryId"
网页源码 {"code":0,"errorCode":null,"errorMessage":null,"message":null,"data":[{"transType":"625808CPAFEG0275","custShortName":"财富财富广场","customerNo":"8620396846","agentShortName":"林林林","serviceShortName":null,"posCati":"15825066","pan":"625808CPAFEG0275","cardType":"2","amount":"100000","status":"5","quickSettleStatus":null,"brsBankResponseCode":"00","createTime":"2019-03-01 10:04:00","summaryId":"1903011004051391","settleAmount":"99620","agentNo":"8368316879"},{"transType":"622623DJHEDG4830","custShortName":"财富财富广场","customerNo":"8620396846","agentShortName":"林林林","serviceShortName":null,"posCati":"15825066","pan":"622623DJHEDG4830","cardType":"2","amount":"148000","status":"5","quickSettleStatus":null,"brsBankResponseCode":"00","createTime":"2019-03-01 10:47:41","summaryId":"1903011047404842","settleAmount":"147200","agentNo":"8368316879"},{"transType":"622623DJHEDG4830","custShortName":"财富财富广场","customerNo":"8620396846","agentShortName":"林林林","serviceShortName":null,"posCati":"15825066","pan":"622623DJHEDG4830","cardType":"2","amount":"158000","status":"5","quickSettleStatus":null,"brsBankResponseCode":"00","createTime":"2019-03-01 11:43:23","summaryId":"1903011143274504","settleAmount":"157146","agentNo":"8368316879"},{"
|
最佳答案
查看完整内容
.计次循环首 (正则.取匹配数量 (), i)
调试输出 (到文本 (到整数 (正则.取子匹配文本 (i, 4)) ÷ 100))
.计次循环尾 ()
求助知识:请将问题描述清楚,最好把你有问题的源码打包上传上来,这样更方便大家帮助你。 友情提醒:本版被采纳的主题可在 申请荣誉值 帖子申请荣誉值,获得 3点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
|