I\'m pretty sure regular expressions are the way to go, but my head hurts whenever I try to work out the specific regular expression.
What regular expression do I ne
If you've a variable number of words that you want to match I would do something like that:
String mystring = "Text I want to match";
String[] matchings = {"warning", "error", "parse", ....}
int matches = 0;
for (int i = 0; i < matchings.length(); i++) {
if (mystring.contains(matchings[i]) {
matches++;
}
}
if (matches == matchings.length) {
System.out.println("All Matches found");
} else {
System.out.println("Some word is not matching :(");
}
Note: I haven't compiled this code, so could contain typos.