我是正则表达式的新手StringTokenizer
,并且每当我将此正则表达式放入时都会出现语法错误matches
:
while ((line = br.readLine()) != null) {
StringTokenizer stringTokenizer = new StringTokenizer(line, "\n");
while (stringTokenizer.hasMoreElements()) {
String function = stringTokenizer.nextElement().toString();
if (function.matches(\\s*(unsigned int|float|int|char|void|double)(\\s)+[a-zA-Z_](\\w)*(\\s)*\\((\\s)*((((unsigned int|float|int|char|double)(\\s)*,(\\s)*)*((unsigned int|float|int|char|double)(\\s)*))|(\\s)*|(void)(\\s)*)\\)(\\s)*\\;)) {
System.out.println("VALID - ");
}
}
}