matlab中用正则表达式如何取两个字符串之间的字符串
例如‘floor_num":2bsaubakejdacbnklsfloor_num":3‘,我要取bsaubakejdacbnkls,节点是在floor_num":2和f...
例如‘floor_num":2bsaubakejdacbnklsfloor_num":3‘,我要取bsaubakejdacbnkls,节点是在floor_num":2和floor_num":3之间
展开
1个回答
展开全部
clear;clc
s='fafw34rfdfloor_num":2bsaubakejdacbnklsfloor_num":3asdf23tfloor_num":4stsmnw54dgfloor_num":212floor_num":234floor_num":3';
regexpi(s,'(?<=floor_num":2).*?(?=floor_num":3)','match')
ans =
'bsaubakejdacbnkls' '12floor_num":234'
追问
我这可能需要匹配的太多了,一直没有出结果,就给你吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询