//发现factorycode单词.
//\\b 表示单词分界符号.
import java.util.regex.*;
String targetStr = "a.factorycode,b.empid afactorycodeb";
String RegexStr="\\bfactorycode\\b";
Pattern p = Pattern.compile(RegexStr);
Matcher m = p.matcher(targetStr);
while ( (m.find()) ) { System.out.println("find");}