(1)正则表达式

前端之家收集整理的这篇文章主要介绍了(1)正则表达式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

public static void main(String[] args) {
// TODO Auto-generated method stub
//String neString="网申管理,许俊帅,张涛";
//String xml = (String) data.get(position).get("location");
// 正则表达式,判断是什么类型的xml文件
/*Pattern pattern = Pattern.compile(",");
Matcher matcher = pattern.matcher(neString);
boolean b = matcher.matches();
System.out.println(b);*/

String st="D:\\TEST.txt";
ok o=new ok();
o.log(st,"12222222");
o.log(st,"222222222222");
o.log(st,"222222222222");
/*String str="糖尿病者禁食,123";

String[] sttr=str.split(",|,");

//String[] strings=neString.split(",|,");
System.out.println(sttr.length);
for (int i = 0; i < sttr.length; i++) {
System.out.println(sttr[i]);
}*/
}

private void log(String path,String content){

FileWriter f; try { f = new FileWriter(path,true); f.write(content+"\n"); f.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }

猜你在找的正则表达式相关文章