JAVA常用正则能用的 -- 色色尝试过的 -- 非网上传播的垃圾版本的

xiaoxiao2026-04-13  7

private void init(){ this.setPatternGroup(new Hashtable<String, String>()); this.getPatternGroup().put("startWith", "^{str}.*"); this.getPatternGroup().put("stopWith", ".*{str}$"); //\w是预定义字符,参见API 单词字符:[a-zA-Z_0-9] this.getPatternGroup().put("sc", "^([a-zA-Z_#0-9\u4E00-\u9FA5]*)$" ); this.getPatternGroup().put("ip", "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"); }

 

今天要用到JAVA正则的,在网上搜了下,国内转载的基本就是无用的,都不知道诸位在哪里抄袭过来的垃圾代码...

对诸位说下,别拿垃圾出来贴,丢人知道不???

 

javaeye上边患有一个说匹配IP 是 d+.d+.d+.d+. 脑子有病,纯粹是!!!

 

里面的IP验证取自于此,老外就是老外,日.就是高手啊!!!

IP验证: http://www.gamedev.net/community/forums/topic.asp?topic_id=357270

 

 

文档是 正则表达式和 元数据编程

 

 

 

js回退解决方案 http://www.javaread.com/question/show/55

转载请注明原文地址: https://www.6miu.com/read-5047294.html

最新回复(0)