package com.test;
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class FileReadWrite {
public static void main(String[] args){
FileReader fRd = null;
FileWriter fWt = null;
try {
// //
// fRd = new FileReader("D:\\FRANLK\\temp\\txt.TXT");
// fWt = new FileWriter("D:\\FRANLK\\temp\\out.TXT");
// BufferedReader bufRd = new BufferedReader(fRd);
// BufferedWriter bufWt = new BufferedWriter(fWt);
// String strLine=bufRd.readLine();
// while(strLine!=null){
// System.out.println("--------"+strLine);
// bufWt.newLine();
// String strReg ="%[a-zA-Z]+%";
// bufWt.write("*****+++*"+strLine);
// Pattern ptn = Pattern.compile(strReg);
// Matcher mth =ptn.matcher(strLine);
// System.out.println("aaaaaaaa--"+mth.group(0));
// bufWt.newLine();
// strLine=bufRd.readLine();
// }
// bufRd.close();
// fRd.close();
// bufWt.flush();
// bufWt.close();
// fWt.close();
String regEx="^%\\w+%";
String regEx2 = "%\\w+\\(";
String regEx3 = "@.+。$";
String regEx4 = "^%{1}(\\w+)%{1}(\\w+\\(\\))@{1}(.+)。$";
String str="%int%available()@返回可以不受阻塞地从此文件输入流中读取的字节数。";
Pattern p = Pattern.compile(regEx4);
Matcher m =p.matcher(str);
boolean rs=m.find();
System.out.println("find---"+rs);
System.out.println("++++"+m.groupCount());
for(int i=1;i<=m.groupCount();i++){
System.out.println(m.group(i));
}
} catch (Exception e) {
e.printStackTrace();
}
}
}