String.matches() Regex?

I am using the String method .matches(Pattern: Regex), but it seems that this is only true when the whole string matches the pattern known, If some string methods don’t need to match with the whole pattern?

discover the existence of the .find method in regex

Regex#containsMatchIn would also work?

1 Like

I think you want contains instead of matches.

Yep