The issue is not Pattern.quote
, but rather your use of Matcher.find:
Attempts to find the next subsequence of the input sequence that matches the pattern. This method returns true if a subsequence of the input sequence matches this Matcher object's pattern.
So Matcher.find
skips non-matching data to find the next match.