SyntaxFix
Write A Post
Hire A Developer
Questions
One problem with the answer by Dave L. is when s2 contains regex markup such as \d, etc.
\d
You want to call Pattern.quote() on s2:
Pattern.compile(Pattern.quote(s2), Pattern.CASE_INSENSITIVE).matcher(s1).find();