I'm not sure I follow you here.
That above will work fine.
PHP Code:
String str = "anything /SOMETHING/ done";
String queryString = "/something/";
String[] a = str.split(" ");
for (String s : a)
{
if (s.matches("(?i).*" + queryString + ".*"))
{
System.out.println(s + " is a match.");
}
}
Will result in:
Code:
/SOMETHING/ is a match
So since the structure works, it's a problem with the pattern not matching the data.