标签:tar group row pattern contains match word log 查找
Pattern p=Pattern.compile("[a-zA-Z0-9]+");
Matcher w=p.matcher(str);
while(w.find()){
String word=w.group();
int index=w.start();
if(!dictionary.containsKey(word)){
ArrayList<Location> list=new ArrayList<Location>();
dictionary.put(word, list);
}
ArrayList<Location> list=dictionary.get(word);
Location pair=new Location(row,index);
list.add(pair);
dictionary.put(word, list);
//System.out.println(index);
}
标签:tar group row pattern contains match word log 查找
原文地址:http://www.cnblogs.com/mzybuaa/p/7169245.html