public class ClassPathResource {
public static boolean isMobileNO(String mobiles) {
Pattern p = Pattern
.compile("^(([-])|([^,//D])|([,-]))//d{}$");
Matcher m = p.matcher(mobiles);
System.out.println(m.matches() + "---");
return m.matches();
}
public static void main(String[] args) throws IOException {
System.out.println(ClassPathResource.isMobileNO(""));
}
}
public class ClassPathResource {
public static boolean isMobileNO(String mobiles) {
Pattern p = Pattern
.compile("^(([-])|([^,//D])|([,-]))//d{}$");
Matcher m = p.matcher(mobiles);
System.out.println(m.matches() + "---");
return m.matches();
}
public static void main(String[] args) throws IOException {
System.out.println(ClassPathResource.isMobileNO(""));
}
}
public static boolean isEmail(String strEmail) {
String strPattern = "^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$";
Pattern p = Pattern.compile(strPattern);
Matcher m = p.matcher(strEmail);
return m.matches();
}
public static boolean isEmail(String strEmail) {
String strPattern = "^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$";
Pattern p = Pattern.compile(strPattern);
Matcher m = p.matcher(strEmail);
return m.matches();
}
import Android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class Main extends Activity {
private EditText editText;
private Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
editText = (EditText) findViewById(R.id.textId);
editText.setText("EditText element");
button = (Button) findViewById(R.id.btnId);
button.setText("Check");
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (checkString(editText.getText().toString())) {
editText.setText("Corect");
}
}
});
}
private boolean checkString(String s) {
return s.matches("\\w*[.](Java|cpp|class)");
}
}
import Android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class Main extends Activity {
private EditText editText;
private Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
editText = (EditText) findViewById(R.id.textId);
editText.setText("EditText element");
button = (Button) findViewById(R.id.btnId);
button.setText("Check");
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (checkString(editText.getText().toString())) {
editText.setText("Corect");
}
}
});
}
private boolean checkString(String s) {
return s.matches("\\w*[.](Java|cpp|class)");
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有