poster
2019-12-01, 22:40
给定一个包含'blabla text (https://www.labfans.com/bbs/admincp/address) blabla'的字符串,我想从中提取'text' 。
regexp (https://www.mathworks.com/help/matlab/ref/regexp.html) doc建议使用'.*'表达式,但它将提取整个 ... 内容。
当然,我可以像这样继续使用strfind :
line = 'blabla text (https://www.labfans.com/bbs/admincp/address) blabla'; atag = regexp(line,'.*','match', 'once'); from = strfind(atag, '>'); to = strfind(atag, '
regexp (https://www.mathworks.com/help/matlab/ref/regexp.html) doc建议使用'.*'表达式,但它将提取整个 ... 内容。
当然,我可以像这样继续使用strfind :
line = 'blabla text (https://www.labfans.com/bbs/admincp/address) blabla'; atag = regexp(line,'.*','match', 'once'); from = strfind(atag, '>'); to = strfind(atag, '