Fou-Lu,
Thanks, you are correct in that it's the pattern; it seems the matches isn't finding the substring anywhere. For example, the 1st works - but teh second doesn't:
Code:
String str = "anything /SOMETHING/ done";
String tstr = "something";
if (tstr.matches("(?i).*/something/.*")) {
out.println(tstr + " text found.");
}
if (tstr.matches("(?i).*anything /SOMETHING/ done.*")) {
out.println(tstr + " text found.");
}
In your example, you used the split to make it work - I can't do so for my purposes because the value I'm searching through won't have any spaces.
Can you tell what's wrong with the matching regex?