在文档中寻找特定字符时出现重叠情况,如何避免?。

在一个文档中寻找‘0 0 0 0 0 0’字符,属于结束特殊字符串,但是文档中会出现0 0 0 0 0 0 0(7个或更多)如图:
如果使用strfind,会出现重叠的情况,比如7个0,其第一个0出现在66,在寻找特定字符串时就会显示66和68,达不到目的,对于这种以及其他更多0的情况如何实现“ 同时处理 ”,避免重叠的情况?

 Accepted Answer

potson
potson on 16 May 2023

0 votes

试一下正则表达式吧,链接如下:

More Answers (0)

Categories

Tags

Asked:

on 16 May 2023

Answered:

on 16 May 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!