SyntaxFix
Write A Post
Hire A Developer
Questions
You can use String#matches method like this:
System.out.printf("Matches - [%s]%n", string.matches("^.*?(item1|item2|item3).*$"));