Skip to main content
1 of 3
Phil W
  • 38.1k
  • 5
  • 53
  • 106

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.

Phil W
  • 38.1k
  • 5
  • 53
  • 106