- 0
- 0
- 约1.22万字
- 约 60页
- 2019-03-04 发布于天津
- 举报
1.6 其它符号 [A-Za-z0-9] [^A-Za-z0-9] 示例 非负整数:[1-9]\d*|0 正整数:[1-9]\d* 英文字符串:[A-Za-z]+ Email地址: \w{1,}@\w{1,}\.\w{1,} 程序 String regex=\\w{1,}@\\w{1,}\\.\\w{1,} ; String str1=zhangsan@; String str2=li@si@; if(str1.matches(regex)) { System.out.println(str1+是一个Email地址); }else { System.out.println(str1+不是一个Email地址); } if(str2.matches(regex)) { System.out.println(str2+是一个Email地址); }else { System.out.println(str2+不是一个Email地址); } 谢谢 * * * 顺便讲一下trim() * * * * * * * * * 只须按动按钮,不需要知道这个玩具
原创力文档

文档评论(0)