The topic is confusing, however for example,
final String pattern = "(abc)";
final String content = "dabcef";
Matcher m = Pattern.compile(pattern).matcher(content);
The m.find() will surely return true.
I want to know if it’s possible to process chars only once, meaning
“dab” -> not found, “cef” -> not found, over.
Thanks!
EDIT:
Actually I want to find all matches instead of only check if matches or not. For example,
abc abc def abc dab cef (actually without spaces)
will be matched by ^(.{3})*?(abc), however only once. And I expect 3 matches.
Thanks!
I found the solution by moving start index. Thank @Oil for the suggestion!