/**
* . 匹配所有字符,除换行服\n
* 如果要匹配"\n"在内的所有字符,一般用[\s\S]
*/
public static String noLineFeed(){
String regular = ".";
String number = "w";
return patternTool(regular,number);
}
public static String patternTool(String regular,String str){
Pattern pattern = Pattern.compile(regular);
Matcher matcher = pattern.matcher(str);
if (matcher.find()){
return matcher.group();
}
return "不匹配";
}