import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class demo1 {
/**java正则表达式
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String email = "cingbo@ss.com";
Pattern patten = Pattern
.compile("[\w\.\-]+@([\w\-]+\.)+[\w\-]+");
Matcher matcher = patten.matcher(email);
System.out.println(matcher.matches());
}
}
版权声明:本文为博主原创文章,未经博主允许不得转载。