📄 tools.java
字号:
package Com.tool;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Tools {
public static boolean Email(String email){
Pattern p = Pattern.compile("[\\w].*@[\\w].*\\.[\\w].*");
Matcher m = p.matcher(email);
return m.matches();
}
public static boolean Birthday(String birthday){
return birthday.matches("[0-2][0-9][0-9][0-9][-|/|\\s][0-1][0-9][-|/|\\s][0-3][0-9]");
}
public static void swap(int a,int b)
{
int t=a;
a=b;
b=t;
}
public static void main(String args[])
{
String str = "240245";
if(str.matches("\\d{2}[0]{4}")|| str.matches("\\d{2}[0][2].*")){
System.out.println(true);
}else
System.out.print("0");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -