string.matches("(. ¦\s)*?测 试(. ¦\s)*?"); 如果匹配的话,马上就有结果返回,反之,就死在那! string.indexof("测 试")> =0是不会有问题的.