Tanya Ruttenberg wrote:Here is the code: String x = "where"; String s = " select name from devices where"; Pattern p = Pattern.compile("where"); Matcher m = p.matcher(s); boolean b = m.matches(); b comes out to false except when s and x are identical.