zno2

随笔分类 -  regexp

Regular Expression
正则非贪婪 (清除java类三种注释)
摘要:最大匹配(默认): 最小匹配(加一个问号): 匹配 // 注释: [\t ]*//.*[^\r\n] 匹配 /** */ doc注释和/* */ 块注释(): [\t ]*/\*[\s\S]*?\*/ 验证: /* * Copyright (c) 1994, 2013, Oracle and/or 阅读全文

posted @ 2023-08-03 19:51 zno2 阅读(45) 评论(0) 推荐(0)

获取 class doc
摘要:目标识别需要具备的特征:有package,是class,/** ... */ doc文档,只识别单行 public static void main(String[] args) { System.out.println(getClassDoc( "package cn.zno.xxx;\r\n" 阅读全文

posted @ 2023-08-03 19:46 zno2 阅读(33) 评论(0) 推荐(0)

匹配一个元素
摘要:例一 <[^><]*> 解释: []* 匹配多个方括号里的 ^>< 非>非< <以< 开头 >以>结尾 [^abc] Any character except a, b, or c (negation) 示例: <input[^><]*> </input> 例二 to_date\([^\(\)]*\ 阅读全文

posted @ 2023-06-01 16:48 zno2 阅读(24) 评论(0) 推荐(0)

eclipse find 两位数
摘要:查找两位数 阅读全文

posted @ 2016-08-06 08:00 zno2 阅读(105) 评论(0) 推荐(0)

空白行 ,空白
摘要:\n\s*\r 应用: 搜索结果: 额外应用,消除xml文件的空白 阅读全文

posted @ 2016-08-06 08:00 zno2 阅读(169) 评论(0) 推荐(0)

生成字母+数字6位字符串
摘要:package test; import java.util.Random; import java.util.regex.Pattern; public class CodeUtil { public static final char[] CHARS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'... 阅读全文

posted @ 2016-08-06 08:00 zno2 阅读(351) 评论(0) 推荐(0)

字母数字组合 正则
摘要:http://www.w3school.com.cn/jsref/jsref_obj_regexp.asp/^[0-9a-zA-Z]*$/g 阅读全文

posted @ 2016-08-06 08:00 zno2 阅读(360) 评论(0) 推荐(0)

导航