Commit 6c6c5f16 authored by DeleMing's avatar DeleMing

<dev>

1. 修改代码
parent 1cb26b74
Pipeline #15202 failed with stages
in 30 seconds
package com.zorkdata.desensitization;
import com.alibaba.fastjson.JSON;
import com.zorkdata.desensitization.config.RegularExpressions;
import com.zorkdata.desensitization.function.DesensitizationFunction;
import java.util.*;
/**
* @author: LiaoMingtao
* @date: 2020/11/7
*/
public class TestDesensitization {
public static void main(String[] args) {
RegularExpressions regularExpressions = new RegularExpressions();
regularExpressions.setNameRegExp("[赵|钱|孙|李|周|吴|郑|王|冯|陈|褚|卫|蒋|沈|韩|杨|朱|秦|尤|许|何|吕|施|张|孔|曹|严|华|金|魏|陶|姜|戚|谢|邹|喻|柏|水|窦|章|云|苏|潘|葛|奚|范|彭|郎|鲁|韦|昌|马|苗|凤|花|方|俞|任|袁|柳|酆|鲍|史|唐|费|廉|岑|薛|雷|贺|倪|汤|滕|殷|罗|毕|郝|邬|安|常|乐|于|时|傅|皮|卞|齐|康|伍|余|元|卜|顾|孟|平|黄|和|穆|萧|尹|姚|邵|湛|汪|祁|毛|禹|狄|米|贝|明|臧|计|伏|成|戴|谈|宋|茅|庞|熊|纪|舒|屈|项|祝|董|梁|杜|阮|蓝|闵|席|季|麻|强|贾|路|娄|危|江|童|颜|郭|梅|盛|林|刁|锺|徐|邱|骆|高|夏|蔡|田|樊|胡|凌|霍|虞|万|支|柯|昝|管|卢|莫|经|房|裘|缪|干|解|应|宗|丁|宣|贲|邓|郁|单|杭|洪|包|诸|左|石|崔|吉|钮|龚|程|嵇|邢|滑|裴|陆|荣|翁|荀|羊|於|惠|甄|麴|家|封|芮|羿|储|靳|汲|邴|糜|松|井|段|富|巫|乌|焦|巴|弓|牧|隗|山|谷|车|侯|宓|蓬|全|郗|班|仰|秋|仲|伊|宫|宁|仇|栾|暴|甘|钭|历|戎|祖|武|符|刘|景|詹|束|龙|叶|幸|司|韶|郜|黎|溥|印|宿|白|怀|蒲|邰|从|鄂|索|咸|籍|卓|蔺|屠|蒙|池|乔|阳|郁|胥|能|苍|双|闻|莘|党|翟|谭|贡|劳|逄|姬|申|扶|堵|冉|宰|郦|雍|却|桑|桂|濮|牛|寿|通|边|扈|燕|冀|浦|尚|农|温|别|庄|晏|柴|瞿|充|慕|连|茹|习|宦|艾|鱼|容|向|古|易|慎|戈|廖|庾|终|暨|居|衡|步|都|耿|满|弘|匡|国|文|寇|广|禄|阙|东|欧|沃|利|蔚|越|夔|隆|师|巩|厍|聂|晁|勾|敖|融|冷|訾|辛|阚|那|简|饶|空|曾|毋|沙|乜|养|鞠|须|丰|巢|关|蒯|相|荆|红|游|竺|权|司马|上官|欧阳|夏侯|诸葛|闻人|东方|赫连|皇甫|尉迟|公羊|澹台|公冶宗政|濮阳|淳于|单于|太叔|申屠|公孙|仲孙|轩辕|令狐|钟离|宇文|长孙|慕容|司徒|司空|召|有|舜|岳|黄辰|寸|贰|皇|侨|彤|竭|端|赫|实|甫|集|象|翠|狂|辟|典|良|函|芒|苦|其|京|中|夕|乌孙|完颜|富察|费莫|蹇|称|诺|来|多|繁|戊|朴|回|毓|鉏|税|荤|靖|绪|愈|硕|牢|买|但|巧|枚|撒|泰|秘|亥|绍|以|壬|森|斋|释|奕|姒|朋|求|羽|用|占|真|穰|翦|闾|漆|贵|代|贯|旁|崇|栋|告|休|褒|谏|锐|皋|闳|在|歧|禾|示|是|委|钊|频|嬴|呼|大|威|昂|律|冒|保|系|抄|定|化|莱|校|么|抗|祢|綦|悟|宏|功|庚|务|敏|捷|拱|兆|丑|丙|畅|苟|随|类|卯|俟|友|答|乙|允|甲|留|尾|佼|玄|乘|裔|延|植|环|矫|赛|昔|侍|度|旷|遇|偶|前|由|咎|塞|敛|受|泷|袭|衅|叔|圣|御|夫|仆|镇|藩|邸|府|掌|首|员|焉|戏|可|智|尔|凭|悉|进|笃|厚|仁|业|肇|资|合|仍|九|衷|哀|刑|俎|仵|圭|夷|徭|蛮|汗|孛|乾|帖|罕|洛|淦|洋|邶|郸|郯|邗|邛|剑|虢|隋|蒿|茆|菅|苌|树|桐|锁|钟|机|盘|铎|斛|玉|线|针|箕|庹|绳|磨|蒉|瓮|弭|刀|疏|牵|浑|恽|势|世|仝|同|蚁|止|戢|睢|冼|种|涂|肖|己|泣|潜|卷|脱|谬|蹉|赧|浮|顿|说|次|错|念|夙|斯|完|丹|表|聊|源|姓|吾|寻|展|出|不|户|闭|才|无|书|学|愚|本|性|雪|霜|烟|寒|少|字|桥|板|斐|独|千|诗|嘉|扬|善|揭|祈|析|赤|紫|青|柔|刚|奇|拜|佛|陀|弥|阿|素|长|僧|隐|仙|隽|宇|祭|酒|淡|塔|琦|闪|始|星|南|天|接|波|碧|速|禚|腾|潮|镜|似|澄|潭|謇|纵|渠|奈|风|春|濯|沐|茂|英|兰|檀|藤|枝|检|生|折|登|驹|骑|貊|虎|肥|鹿|雀|野|禽|飞|节|宜|鲜|粟|栗|豆|帛|官|布|衣|藏|宝|钞|银|门|盈|庆|喜|及|普|建|营|巨|望|希|道|载|声|漫|犁|力|贸|勤|革|改|兴|亓|睦|修|信|闽|北|守|坚|勇|汉|练|尉|士|旅|五|令|将|旗|军|行|奉|敬|恭|仪|母|堂|丘|义|礼|慈|孝|理|伦|卿|问|永|辉|位|让|尧|依|犹|介|承|市|所|苑|杞|剧|第|零|谌|招|续|达|忻|六|鄞|战|迟|候|宛|励|粘|萨|邝|覃|辜|初|楼|城|区|局|台|原|考|妫|纳|泉|老|清|德|卑|过|麦|曲|竹|百|福|言|第五|佟|爱|年|笪|谯|哈|墨|连|南宫|赏|伯|佴|佘|牟|商|西门|东门|左丘|梁丘|琴|后|况|亢|缑|帅|微生|羊舌|海|归|呼延|南门|东郭|百里|钦|鄢|汝|法|闫|楚|晋|谷梁|宰父|夹谷|拓跋|壤驷|乐正|漆雕|公西|巫马|端木|颛孙|子车|督|仉|司寇|亓官|三小|鲜于|锺离|盖|逯|库|郏|逢|阴|薄|厉|稽|闾丘|公良|段干|开|光|操|瑞|眭|泥|运|摩|伟|铁|迮][\\u4e00-\\u9fa5]");
regularExpressions.setPhoneRegExp("0\\d{2,3}-[1-9]\\d{6,7}");
regularExpressions.setMobileRegExp("((\\+|00)86)?((134\\d{4})|((13[0-3|5-9]|14[1|5-9]|15[0-9]|16[2|5|6|7]|17[0-8]|18[0-9]|19[0-2|5-9])\\d{8}))");
regularExpressions.setEmailRegExp("([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\\.[a-zA-Z0-9_-]{1,4}){1,4})");
regularExpressions.setIdRegExp("[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]|[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{2}");
regularExpressions.setBankCardRegExp("(([13-79]\\d{3})|(2[1-9]\\d{2})|(20[3-9]\\d)|(8[01-79]\\d{2}))\\s?\\d{4}\\s?\\d{4}\\s?\\d{4}(\\s?\\d{3})?");
regularExpressions.setAddressRegExp("([\\u4E00-\\u9FA5A-Za-z0-9_]+(省|市|自治区|自治州|区|县|镇|道|路|街|号|弄|条|室)){1,}");
regularExpressions.setIpRegExp("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)");
regularExpressions.setMacRegExp("[A-F0-9]{2}([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})");
DesensitizationFunction desensitizationFunction = new DesensitizationFunction(regularExpressions);
String[] fieldsWhiteListArray = "funcid,count1,count2,count3,count4".split(",");
List< String> whiteList = new ArrayList<>(fieldsWhiteListArray.length);
Collections.addAll(whiteList, fieldsWhiteListArray);
List<String> dataFormats = new ArrayList<String>(){{
  • Move the contents of this initializer to a standard constructor or to field initializers. 📘 🔽 Use another way to initialize this instance. 📘

Please register or sign in to reply
add(",");
add(".");
add("@");
add("-");
add(":");
}};
Map<String, String> map = new HashMap<>(4);
map.put("name", "廖鸣韬");
map.put("mobile", "18570332683");
map.put("phone", "0730-7512340");
map.put("email", "liaomingtao@zork.com.cn");
map.put("id", "430621194711110423");
map.put("bankId", "6222600260001072123");
map.put("address", "上海市浦东新区张江路");
map.put("ip", "192.168.70.1");
  • 🔽 Make this IP "192.168.70.1" address configurable. 📘

Please register or sign in to reply
map.put("mac", "00:0C:29:01:98:27");
map.put("funcid", "1111");
map.put("count1", "普通字段");
map.put("count2", "普通字段4");
map.put("count3", "普通字段5");
map.put("count4", "普通字段6");
map.put("message", "廖鸣韬|18570332683|0730-7638844|liaomingtao@zork.com.cn|430621194711110423|6222600260001072123|上海市浦东新区张江路|192.168.70.1|00:0C:29:01:98:27|1111");
Map<String, String> stringStringMap = desensitizationFunction.desensitization(map, whiteList, dataFormats);
System.out.println(JSON.toJSONString(stringStringMap));
  • Replace this use of System.out or System.err by a logger. 📘

Please register or sign in to reply
}
}
......@@ -23,19 +23,49 @@ public class DesensitizationFunction implements Serializable {
public DesensitizationFunction(RegularExpressions regularExpressions) {
this.regularExpressions = regularExpressions;
}
patterns.add(Pattern.compile(regularExpressions.getIdRegExp()));
patterns.add(Pattern.compile(regularExpressions.getBankCardRegExp()));
patterns.add(Pattern.compile(regularExpressions.getPhoneRegExp()));
patterns.add(Pattern.compile(regularExpressions.getMobileRegExp()));
public Map desensitization(Map map, List<String> whiteList, List<String> dataFormats) {
patterns.add(Pattern.compile(regularExpressions.getAddressRegExp()));
patterns.add(Pattern.compile(regularExpressions.getNameRegExp()));
patterns.add(Pattern.compile(regularExpressions.getMacRegExp()));
patterns.add(Pattern.compile(regularExpressions.getEmailRegExp()));
patterns.add(Pattern.compile(regularExpressions.getIpRegExp()));
patterns.add(Pattern.compile(regularExpressions.getIpRegExp()));
patterns.add(Pattern.compile(regularExpressions.getBankCardRegExp()));
patterns.add(Pattern.compile(regularExpressions.getMobileRegExp()));
patterns.add(Pattern.compile(regularExpressions.getPhoneRegExp()));
patterns.add(Pattern.compile(regularExpressions.getAddressRegExp()));
}
public Map<String, String> desensitization(Map<String, String> map,
  • 🚫 Refactor this method to reduce its Cognitive Complexity from 22 to the 15 allowed. 📘

Please register or sign in to reply
List<String> whiteList, List<String> dataFormats) {
Iterator<Map.Entry<String, String>> entryIterator = map.entrySet().iterator();
while (entryIterator.hasNext()) {
Map.Entry<String, String> next = entryIterator.next();
String key = next.getKey();
String value = next.getValue();
if (!whiteList.contains(key)) {
// 执行脱敏操作
for (Pattern pattern : patterns) {
Matcher matcher = pattern.matcher(value);
if (matcher.find()) {
String replaceStr = "";
for (int i = 0; i < matcher.group().length(); i++) {
String s = String.valueOf(matcher.group().charAt(i));
if(dataFormats.contains(s)){
replaceStr = replaceStr.concat(s);
}else{
replaceStr = replaceStr.concat("*");
}
}
value = value.replace(matcher.group(), replaceStr);
map.put(key, value);
}
}
}
}
return map;
}
public Map desensitizationTemp(Map map, List<String> whiteList, List<String> dataFormats) {
  • 🚫 Refactor this method to reduce its Cognitive Complexity from 22 to the 15 allowed. 📘

Please register or sign in to reply
map.forEach((k, v) -> {
if (!whiteList.contains(k)) {
String value = v.toString();
......@@ -63,45 +93,4 @@ public class DesensitizationFunction implements Serializable {
return map;
}
public static void main(String[] args) {
RegularExpressions regularExpressions = new RegularExpressions();
regularExpressions.setAddressRegExp("([\u4E00-\u9FA5A-Za-z0-9_]+(省|市|区|县|道|路|街|号|弄|条|室)){2,}");
regularExpressions.setBankCardRegExp("([1-9]{1})(\\d{11}|\\d{15}|\\d{16}|\\d{17}|\\d{18})");
regularExpressions.setEmailRegExp("[a-zA-Z0-9]+@[a-zA-Z0-9]+(\\.[a-zA-Z0-9]+)+");
regularExpressions.setIdRegExp("[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9Xx])");
regularExpressions.setIpRegExp("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)");
regularExpressions.setMacRegExp("([A-Fa-f0-9]{2}-){5}[A-Fa-f0-9]{2}");
regularExpressions.setMobileRegExp("((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|(147))\\d{8}");
regularExpressions.setPhoneRegExp("0\\d{2,3}-\\d{7,8}");
regularExpressions.setNameRegExp("[\\u4e00-\\u9fa5]{1,20}|[a-zA-Z\\\\.\\\\s]{1,20}");
DesensitizationFunction desensitizationFunction = new DesensitizationFunction(regularExpressions);
Map map = new HashMap(16);
map.put("姓名", "王海鹰");
map.put("身份证号", "372925199101195158");
map.put("手机号", "15000101879");
map.put("电话", "021-61341606");
map.put("邮箱", "wanghaiying@zork.com");
map.put("住址", "上海市浦东新区碧波路690号1弄");
map.put("住址2", "上海市浦东新区张江微电子港304-2室");
map.put("ip地址", "192.168.70.2");
map.put("mac地址", "3c-78-43-25-80-bd");
map.put("message", "王海鹰,372925199008075158#15000101879");
map.put("messid", "0000011404342B32233DDCDA");
map.put("bsflag", "0000011404342B32233DDCDA");
map.put("test", "wanghaiying123");
map.put("normalFields", "13811110000-110101199003075517-上海市浦东新区张江微电子港-zorkdata@163.com-123456789-wanghaiying123-王海鹰-192.168.1.1-00-50-56-C0-00-08-6227002470170278192");
String[] fieldsWhiteListArray = "messid,fundid,custid,orgid,brhid,secuid,bankcode,market,ordersno,ordergroup,count,poststr,stkcode,bsflag,orderamt,price,qty,bankcode,tacode,ofcode,transacc,taacc".split(",");
List< String> fieldsWhiteList = new ArrayList<>(fieldsWhiteListArray.length);
Collections.addAll(fieldsWhiteList, fieldsWhiteListArray);
List<String> dataFormats = new ArrayList<String>(){{
add(",");
add(".");
add("@");
add("-");
}};
System.out.println(JSON.toJSONString(desensitizationFunction.desensitization(map, fieldsWhiteList, dataFormats)));
}
}
......@@ -51,6 +51,13 @@ public class HdfsLogDesensitization implements Serializable {
private static final String AVRO_OUTPUT_SCHEMA = "avro.output.schema";
private static final String HOSTNAME = "hostname";
private static final List<String> dataFormats = new ArrayList<String>() {{
  • 🚫 常量【dataFormats】命名应全部大写并以下划线分隔 📘 Move the contents of this initializer to a standard constructor or to field initializers. 📘 🔽 Use another way to initialize this instance. 📘

Please register or sign in to reply
add(",");
add(".");
add("@");
add("-");
add(":");
}};
private String jobName;
private int sourceParallelism;
......@@ -133,12 +140,6 @@ public class HdfsLogDesensitization implements Serializable {
if (null != core && logData.getDimensions().get(HOSTNAME).contains(core)) {
//根据日志事件的timestamp做过滤
Long timestamp = DateUtil.utc2timestamp(logData.getTimestamp());
List<String> dataFormats = new ArrayList<String>() {{
add(",");
add(".");
add("@");
add("-");
}};
if (null != timestamp && timestamp.compareTo(startTimestamp) >= 0 &&
timestamp.compareTo(endTimestamp) <= 0) {
......
......@@ -12,9 +12,9 @@ source: "hdfs"
core: "c9"
# 查询日志起始
start_time: "2020-11-07 16:36:20"
start_time: "2020-11-07 21:22:20"
# 查询日志结束
end_time: "2020-11-07 17:40:30"
end_time: "2020-11-07 23:40:30"
# hadoop 相关配置
# hdfs 地址
......@@ -29,23 +29,3 @@ hdfs_dest: "hdfs://cdh-2:8020/tmp/datawarehouse/jzjy/kcbp_biz_log/output1/"
# 不做脱敏的字段白名单
fields_white_list: "messid,fundid,custid,orgid,brhid,secuid,bankcode,market,ordersno,ordergroup,count,poststr,stkcode,bsflag,orderamt,price,qty,bankcode,tacode,ofcode,transacc,taacc,indexTime,logchecktime,end_logtime,collecttime,deserializerTime,versioninfo,fmillsecond,smillsecond"
# 脱敏用的正则表达式
#reg_exp:
# # 姓名正则
# name: '(\u8d75|\u94b1|\u5b59|\u674e|\u5468|\u5434|\u90d1|\u738b|\u51af|\u9648|\u696e|\u536b|\u848b|\u6c88|\u97e9|\u6768|\u6731|\u79e6|\u5c24|\u8bb8|\u4f55|\u5415|\u65bd|\u5f20|\u5b54|\u66f9|\u4e25|\u534e|\u91d1|\u9b4f|\u9676|\u59dc|\u621a|\u8c22|\u90b9|\u55bb|\u67cf|\u6c34|\u7aa6|\u7ae0|\u4e91|\u82cf|\u6f58|\u845b|\u595a|\u8303|\u5f6d|\u90ce|\u9c81|\u97e6|\u660c|\u9a6c|\u82d7|\u51e4|\u82b1|\u65b9|\u4fde|\u4efb|\u8881|\u67f3|\u9146|\u9c8d|\u53f2|\u5510|\u8d39|\u5ec9|\u5c91|\u859b|\u96f7|\u8d3a|\u502a|\u6c64|\u6ed5|\u6bb7|\u7f57|\u6bd5|\u90dd|\u90ac|\u5b89|\u5e38|\u4e50|\u4e8e|\u65f6|\u5085|\u76ae|\u535e|\u9f50|\u5eb7|\u4f0d|\u4f59|\u5143|\u535c|\u987e|\u5b5f|\u5e73|\u9ec4|\u548c|\u7a46|\u8427|\u5c39|\u59da|\u90b5|\u6e5b|\u6c6a|\u7941|\u6bdb|\u79b9|\u72c4|\u7c73|\u8d1d|\u660e|\u81e7|\u8ba1|\u4f0f|\u6210|\u6234|\u8c08|\u5b8b|\u8305|\u5e9e|\u718a|\u7eaa|\u8212|\u5c48|\u9879|\u795d|\u8463|\u6881|\u675c|\u962e|\u84dd|\u95fd|\u5e2d|\u5b63|\u9ebb|\u5f3a|\u8d3e|\u8def|\u5a04|\u5371|\u6c5f|\u7ae5|\u989c|\u90ed|\u6885|\u76db|\u6797|\u5201|\u953a|\u5f90|\u4e18|\u9a86|\u9ad8|\u590f|\u8521|\u7530|\u6a0a|\u80e1|\u51cc|\u970d|\u865e|\u4e07|\u652f|\u67ef|\u661d|\u7ba1|\u5362|\u83ab|\u7ecf|\u623f|\u88d8|\u7f2a|\u5e72|\u89e3|\u5e94|\u5b97|\u4e01|\u5ba3|\u8d32|\u9093|\u90c1|\u5355|\u676d|\u6d2a|\u5305|\u8bf8|\u5de6|\u77f3|\u5d14|\u5409|\u94ae|\u9f9a|\u7a0b|\u5d47|\u90a2|\u6ed1|\u88f4|\u9646|\u8363|\u7fc1|\u8340|\u7f8a|\u65bc|\u60e0|\u7504|\u9eb9|\u5bb6|\u5c01|\u82ae|\u7fbf|\u50a8|\u9773|\u6c72|\u90b4|\u7cdc|\u677e|\u4e95|\u6bb5|\u5bcc|\u5deb|\u4e4c|\u7126|\u5df4|\u5f13|\u7267|\u9697|\u5c71|\u8c37|\u8f66|\u4faf|\u5b93|\u84ec|\u5168|\u90d7|\u73ed|\u4ef0|\u79cb|\u4ef2|\u4f0a|\u5bab|\u5b81|\u4ec7|\u683e|\u66b4|\u7518|\u659c|\u5389|\u620e|\u7956|\u6b66|\u7b26|\u5218|\u666f|\u8a79|\u675f|\u9f99|\u53f6|\u5e78|\u53f8|\u97f6|\u90dc|\u9ece|\u84df|\u8584|\u5370|\u5bbf|\u767d|\u6000|\u84b2|\u90b0|\u4ece|\u9102|\u7d22|\u54b8|\u7c4d|\u8d56|\u5353|\u853a|\u5c60|\u8499|\u6c60|\u4e54|\u9634|\u90c1|\u80e5|\u80fd|\u82cd|\u53cc|\u95fb|\u8398|\u515a|\u7fdf|\u8c2d|\u8d21|\u52b3|\u9004|\u59ec|\u7533|\u6276|\u5835|\u5189|\u5bb0|\u90e6|\u96cd|\u90e4|\u74a9|\u6851|\u6842|\u6fee|\u725b|\u5bff|\u901a|\u8fb9|\u6248|\u71d5|\u5180|\u90cf|\u6d66|\u5c1a|\u519c|\u6e29|\u522b|\u5e84|\u664f|\u67f4|\u77bf|\u960e|\u5145|\u6155|\u8fde|\u8339|\u4e60|\u5ba6|\u827e|\u9c7c|\u5bb9|\u5411|\u53e4|\u6613|\u614e|\u6208|\u5ed6|\u5ebe|\u7ec8|\u66a8|\u5c45|\u8861|\u6b65|\u90fd|\u803f|\u6ee1|\u5f18|\u5321|\u56fd|\u6587|\u5bc7|\u5e7f|\u7984|\u9619|\u4e1c|\u6b27|\u6bb3|\u6c83|\u5229|\u851a|\u8d8a|\u5914|\u9686|\u5e08|\u5de9|\u538d|\u8042|\u6641|\u52fe|\u6556|\u878d|\u51b7|\u8a3e|\u8f9b|\u961a|\u90a3|\u7b80|\u9976|\u7a7a|\u66fe|\u6bcb|\u6c99|\u4e5c|\u517b|\u97a0|\u987b|\u4e30|\u5de2|\u5173|\u84af|\u76f8|\u67e5|\u540e|\u8346|\u7ea2|\u6e38|\u7afa|\u6743|\u9011|\u76d6|\u76ca|\u6853|\u516c|\u4e07\u4fdf|\u53f8\u9a6c|\u4e0a\u5b98|\u6b27\u9633|\u590f\u4faf|\u8bf8\u845b|\u95fb\u4eba|\u4e1c\u65b9|\u8d6b\u8fde|\u7687\u752b|\u5c09\u8fdf|\u516c\u7f8a|\u6fb9\u53f0|\u516c\u51b6|\u5b97\u653f|\u6fee\u9633|\u6df3\u4e8e|\u5355\u4e8e|\u592a\u53d4|\u7533\u5c60|\u516c\u5b59|\u4ef2\u5b59|\u8f69\u8f95|\u4ee4\u72d0|\u953a\u79bb|\u5b87\u6587|\u957f\u5b59|\u6155\u5bb9|\u9c9c\u4e8e|\u95fe\u4e18|\u53f8\u5f92|\u53f8\u7a7a|\u4e0c\u5b98|\u53f8\u5bc7|\u4ec9|\u7763|\u5b50\u8f66|\u989b\u5b59|\u7aef\u6728|\u5deb\u9a6c|\u516c\u897f|\u6f06\u96d5|\u4e50\u6b63|\u58e4\u9a77|\u516c\u826f|\u62d3\u62d4|\u5939\u8c37|\u5bb0\u7236|\u8c37\u6881|\u664b|\u695a|\u960e|\u6cd5|\u6c5d|\u9122|\u6d82|\u94a6|\u6bb5\u5e72|\u767e\u91cc|\u4e1c\u90ed|\u5357\u95e8|\u547c\u5ef6|\u5f52|\u6d77|\u7f8a\u820c|\u5fae\u751f|\u5cb3|\u5e05|\u7f11|\u4ea2|\u51b5|\u540e|\u6709|\u7434|\u6881\u4e18|\u5de6\u4e18|\u4e1c\u95e8|\u897f\u95e8|\u5546|\u725f|\u4f58|\u4f74|\u4f2f|\u8d4f|\u5357\u5bab|\u58a8|\u54c8|\u8c2f|\u7b2a|\u5e74|\u7231|\u9633|\u4f5f|\u7b2c\u4e94|\u8a00|\u798f)(\w{1,1})'
# # 手机号正则
# mobile: '((\+|00)86)?((134\d{4})|((13[0-3|5-9]|14[1|5-9]|15[0-9]|16[2|5|6|7]|17[0-8]|18[0-9]|19[0-2|5-9])\d{8}))'
# # 电话号码正则
# phone: '((((010)|(0[2-9]\d{1,2}))[-\s]?)[1-9]\d{6,7}$)|((\+?0?86\-?)?1[3|4|5|7|8][0-9]\d{8}$)'
# # 邮箱正则
# email: '([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{1,4}){1,4})'
# # 身份证号码正则
# id: '[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}'
# # 银行卡号
# bank_card: '(([13-79]\d{3})|(2[1-9]\d{2})|(20[3-9]\d)|(8[01-79]\d{2}))\s?\d{4}\s?\d{4}\s?\d{4}(\s?\d{3})?$'
# # 家庭住址正则
# address: '([\u4E00-\u9FA5A-Za-z0-9_]+(省|市|自治区|自治州|区|县|镇|道|路|街|号|弄|条|室)){1,}'
# # ip地址正则
# ip: '((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)'
# # mac地址正则
# mac: '[A-F0-9]{2}([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})$'
\ No newline at end of file
......@@ -47,3 +47,24 @@ reg_exp:
ip: "((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)"
# mac地址正则
mac: "([A-Fa-f0-9]{2}-){5}[A-Fa-f0-9]{2}"
# 脱敏用的正则表达式
#reg_exp:
# # 姓名正则
# name: '(\u8d75|\u94b1|\u5b59|\u674e|\u5468|\u5434|\u90d1|\u738b|\u51af|\u9648|\u696e|\u536b|\u848b|\u6c88|\u97e9|\u6768|\u6731|\u79e6|\u5c24|\u8bb8|\u4f55|\u5415|\u65bd|\u5f20|\u5b54|\u66f9|\u4e25|\u534e|\u91d1|\u9b4f|\u9676|\u59dc|\u621a|\u8c22|\u90b9|\u55bb|\u67cf|\u6c34|\u7aa6|\u7ae0|\u4e91|\u82cf|\u6f58|\u845b|\u595a|\u8303|\u5f6d|\u90ce|\u9c81|\u97e6|\u660c|\u9a6c|\u82d7|\u51e4|\u82b1|\u65b9|\u4fde|\u4efb|\u8881|\u67f3|\u9146|\u9c8d|\u53f2|\u5510|\u8d39|\u5ec9|\u5c91|\u859b|\u96f7|\u8d3a|\u502a|\u6c64|\u6ed5|\u6bb7|\u7f57|\u6bd5|\u90dd|\u90ac|\u5b89|\u5e38|\u4e50|\u4e8e|\u65f6|\u5085|\u76ae|\u535e|\u9f50|\u5eb7|\u4f0d|\u4f59|\u5143|\u535c|\u987e|\u5b5f|\u5e73|\u9ec4|\u548c|\u7a46|\u8427|\u5c39|\u59da|\u90b5|\u6e5b|\u6c6a|\u7941|\u6bdb|\u79b9|\u72c4|\u7c73|\u8d1d|\u660e|\u81e7|\u8ba1|\u4f0f|\u6210|\u6234|\u8c08|\u5b8b|\u8305|\u5e9e|\u718a|\u7eaa|\u8212|\u5c48|\u9879|\u795d|\u8463|\u6881|\u675c|\u962e|\u84dd|\u95fd|\u5e2d|\u5b63|\u9ebb|\u5f3a|\u8d3e|\u8def|\u5a04|\u5371|\u6c5f|\u7ae5|\u989c|\u90ed|\u6885|\u76db|\u6797|\u5201|\u953a|\u5f90|\u4e18|\u9a86|\u9ad8|\u590f|\u8521|\u7530|\u6a0a|\u80e1|\u51cc|\u970d|\u865e|\u4e07|\u652f|\u67ef|\u661d|\u7ba1|\u5362|\u83ab|\u7ecf|\u623f|\u88d8|\u7f2a|\u5e72|\u89e3|\u5e94|\u5b97|\u4e01|\u5ba3|\u8d32|\u9093|\u90c1|\u5355|\u676d|\u6d2a|\u5305|\u8bf8|\u5de6|\u77f3|\u5d14|\u5409|\u94ae|\u9f9a|\u7a0b|\u5d47|\u90a2|\u6ed1|\u88f4|\u9646|\u8363|\u7fc1|\u8340|\u7f8a|\u65bc|\u60e0|\u7504|\u9eb9|\u5bb6|\u5c01|\u82ae|\u7fbf|\u50a8|\u9773|\u6c72|\u90b4|\u7cdc|\u677e|\u4e95|\u6bb5|\u5bcc|\u5deb|\u4e4c|\u7126|\u5df4|\u5f13|\u7267|\u9697|\u5c71|\u8c37|\u8f66|\u4faf|\u5b93|\u84ec|\u5168|\u90d7|\u73ed|\u4ef0|\u79cb|\u4ef2|\u4f0a|\u5bab|\u5b81|\u4ec7|\u683e|\u66b4|\u7518|\u659c|\u5389|\u620e|\u7956|\u6b66|\u7b26|\u5218|\u666f|\u8a79|\u675f|\u9f99|\u53f6|\u5e78|\u53f8|\u97f6|\u90dc|\u9ece|\u84df|\u8584|\u5370|\u5bbf|\u767d|\u6000|\u84b2|\u90b0|\u4ece|\u9102|\u7d22|\u54b8|\u7c4d|\u8d56|\u5353|\u853a|\u5c60|\u8499|\u6c60|\u4e54|\u9634|\u90c1|\u80e5|\u80fd|\u82cd|\u53cc|\u95fb|\u8398|\u515a|\u7fdf|\u8c2d|\u8d21|\u52b3|\u9004|\u59ec|\u7533|\u6276|\u5835|\u5189|\u5bb0|\u90e6|\u96cd|\u90e4|\u74a9|\u6851|\u6842|\u6fee|\u725b|\u5bff|\u901a|\u8fb9|\u6248|\u71d5|\u5180|\u90cf|\u6d66|\u5c1a|\u519c|\u6e29|\u522b|\u5e84|\u664f|\u67f4|\u77bf|\u960e|\u5145|\u6155|\u8fde|\u8339|\u4e60|\u5ba6|\u827e|\u9c7c|\u5bb9|\u5411|\u53e4|\u6613|\u614e|\u6208|\u5ed6|\u5ebe|\u7ec8|\u66a8|\u5c45|\u8861|\u6b65|\u90fd|\u803f|\u6ee1|\u5f18|\u5321|\u56fd|\u6587|\u5bc7|\u5e7f|\u7984|\u9619|\u4e1c|\u6b27|\u6bb3|\u6c83|\u5229|\u851a|\u8d8a|\u5914|\u9686|\u5e08|\u5de9|\u538d|\u8042|\u6641|\u52fe|\u6556|\u878d|\u51b7|\u8a3e|\u8f9b|\u961a|\u90a3|\u7b80|\u9976|\u7a7a|\u66fe|\u6bcb|\u6c99|\u4e5c|\u517b|\u97a0|\u987b|\u4e30|\u5de2|\u5173|\u84af|\u76f8|\u67e5|\u540e|\u8346|\u7ea2|\u6e38|\u7afa|\u6743|\u9011|\u76d6|\u76ca|\u6853|\u516c|\u4e07\u4fdf|\u53f8\u9a6c|\u4e0a\u5b98|\u6b27\u9633|\u590f\u4faf|\u8bf8\u845b|\u95fb\u4eba|\u4e1c\u65b9|\u8d6b\u8fde|\u7687\u752b|\u5c09\u8fdf|\u516c\u7f8a|\u6fb9\u53f0|\u516c\u51b6|\u5b97\u653f|\u6fee\u9633|\u6df3\u4e8e|\u5355\u4e8e|\u592a\u53d4|\u7533\u5c60|\u516c\u5b59|\u4ef2\u5b59|\u8f69\u8f95|\u4ee4\u72d0|\u953a\u79bb|\u5b87\u6587|\u957f\u5b59|\u6155\u5bb9|\u9c9c\u4e8e|\u95fe\u4e18|\u53f8\u5f92|\u53f8\u7a7a|\u4e0c\u5b98|\u53f8\u5bc7|\u4ec9|\u7763|\u5b50\u8f66|\u989b\u5b59|\u7aef\u6728|\u5deb\u9a6c|\u516c\u897f|\u6f06\u96d5|\u4e50\u6b63|\u58e4\u9a77|\u516c\u826f|\u62d3\u62d4|\u5939\u8c37|\u5bb0\u7236|\u8c37\u6881|\u664b|\u695a|\u960e|\u6cd5|\u6c5d|\u9122|\u6d82|\u94a6|\u6bb5\u5e72|\u767e\u91cc|\u4e1c\u90ed|\u5357\u95e8|\u547c\u5ef6|\u5f52|\u6d77|\u7f8a\u820c|\u5fae\u751f|\u5cb3|\u5e05|\u7f11|\u4ea2|\u51b5|\u540e|\u6709|\u7434|\u6881\u4e18|\u5de6\u4e18|\u4e1c\u95e8|\u897f\u95e8|\u5546|\u725f|\u4f58|\u4f74|\u4f2f|\u8d4f|\u5357\u5bab|\u58a8|\u54c8|\u8c2f|\u7b2a|\u5e74|\u7231|\u9633|\u4f5f|\u7b2c\u4e94|\u8a00|\u798f)(\w{1,1})'
# # 手机号正则
# mobile: '((\+|00)86)?((134\d{4})|((13[0-3|5-9]|14[1|5-9]|15[0-9]|16[2|5|6|7]|17[0-8]|18[0-9]|19[0-2|5-9])\d{8}))'
# # 电话号码正则
# phone: '((((010)|(0[2-9]\d{1,2}))[-\s]?)[1-9]\d{6,7}$)|((\+?0?86\-?)?1[3|4|5|7|8][0-9]\d{8}$)'
# # 邮箱正则
# email: '([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{1,4}){1,4})'
# # 身份证号码正则
# id: '[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}'
# # 银行卡号
# bank_card: '(([13-79]\d{3})|(2[1-9]\d{2})|(20[3-9]\d)|(8[01-79]\d{2}))\s?\d{4}\s?\d{4}\s?\d{4}(\s?\d{3})?$'
# # 家庭住址正则
# address: '([\u4E00-\u9FA5A-Za-z0-9_]+(省|市|自治区|自治州|区|县|镇|道|路|街|号|弄|条|室)){1,}'
# # ip地址正则
# ip: '((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)'
# # mac地址正则
# mac: '[A-F0-9]{2}([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})$'
# 警告:请不要修改文本行数与顺序
# 姓名正则
name=(\u8d75|\u94b1|\u5b59|\u674e|\u5468|\u5434|\u90d1|\u738b|\u51af|\u9648|\u696e|\u536b|\u848b|\u6c88|\u97e9|\u6768|\u6731|\u79e6|\u5c24|\u8bb8|\u4f55|\u5415|\u65bd|\u5f20|\u5b54|\u66f9|\u4e25|\u534e|\u91d1|\u9b4f|\u9676|\u59dc|\u621a|\u8c22|\u90b9|\u55bb|\u67cf|\u6c34|\u7aa6|\u7ae0|\u4e91|\u82cf|\u6f58|\u845b|\u595a|\u8303|\u5f6d|\u90ce|\u9c81|\u97e6|\u660c|\u9a6c|\u82d7|\u51e4|\u82b1|\u65b9|\u4fde|\u4efb|\u8881|\u67f3|\u9146|\u9c8d|\u53f2|\u5510|\u8d39|\u5ec9|\u5c91|\u859b|\u96f7|\u8d3a|\u502a|\u6c64|\u6ed5|\u6bb7|\u7f57|\u6bd5|\u90dd|\u90ac|\u5b89|\u5e38|\u4e50|\u4e8e|\u65f6|\u5085|\u76ae|\u535e|\u9f50|\u5eb7|\u4f0d|\u4f59|\u5143|\u535c|\u987e|\u5b5f|\u5e73|\u9ec4|\u548c|\u7a46|\u8427|\u5c39|\u59da|\u90b5|\u6e5b|\u6c6a|\u7941|\u6bdb|\u79b9|\u72c4|\u7c73|\u8d1d|\u660e|\u81e7|\u8ba1|\u4f0f|\u6210|\u6234|\u8c08|\u5b8b|\u8305|\u5e9e|\u718a|\u7eaa|\u8212|\u5c48|\u9879|\u795d|\u8463|\u6881|\u675c|\u962e|\u84dd|\u95fd|\u5e2d|\u5b63|\u9ebb|\u5f3a|\u8d3e|\u8def|\u5a04|\u5371|\u6c5f|\u7ae5|\u989c|\u90ed|\u6885|\u76db|\u6797|\u5201|\u953a|\u5f90|\u4e18|\u9a86|\u9ad8|\u590f|\u8521|\u7530|\u6a0a|\u80e1|\u51cc|\u970d|\u865e|\u4e07|\u652f|\u67ef|\u661d|\u7ba1|\u5362|\u83ab|\u7ecf|\u623f|\u88d8|\u7f2a|\u5e72|\u89e3|\u5e94|\u5b97|\u4e01|\u5ba3|\u8d32|\u9093|\u90c1|\u5355|\u676d|\u6d2a|\u5305|\u8bf8|\u5de6|\u77f3|\u5d14|\u5409|\u94ae|\u9f9a|\u7a0b|\u5d47|\u90a2|\u6ed1|\u88f4|\u9646|\u8363|\u7fc1|\u8340|\u7f8a|\u65bc|\u60e0|\u7504|\u9eb9|\u5bb6|\u5c01|\u82ae|\u7fbf|\u50a8|\u9773|\u6c72|\u90b4|\u7cdc|\u677e|\u4e95|\u6bb5|\u5bcc|\u5deb|\u4e4c|\u7126|\u5df4|\u5f13|\u7267|\u9697|\u5c71|\u8c37|\u8f66|\u4faf|\u5b93|\u84ec|\u5168|\u90d7|\u73ed|\u4ef0|\u79cb|\u4ef2|\u4f0a|\u5bab|\u5b81|\u4ec7|\u683e|\u66b4|\u7518|\u659c|\u5389|\u620e|\u7956|\u6b66|\u7b26|\u5218|\u666f|\u8a79|\u675f|\u9f99|\u53f6|\u5e78|\u53f8|\u97f6|\u90dc|\u9ece|\u84df|\u8584|\u5370|\u5bbf|\u767d|\u6000|\u84b2|\u90b0|\u4ece|\u9102|\u7d22|\u54b8|\u7c4d|\u8d56|\u5353|\u853a|\u5c60|\u8499|\u6c60|\u4e54|\u9634|\u90c1|\u80e5|\u80fd|\u82cd|\u53cc|\u95fb|\u8398|\u515a|\u7fdf|\u8c2d|\u8d21|\u52b3|\u9004|\u59ec|\u7533|\u6276|\u5835|\u5189|\u5bb0|\u90e6|\u96cd|\u90e4|\u74a9|\u6851|\u6842|\u6fee|\u725b|\u5bff|\u901a|\u8fb9|\u6248|\u71d5|\u5180|\u90cf|\u6d66|\u5c1a|\u519c|\u6e29|\u522b|\u5e84|\u664f|\u67f4|\u77bf|\u960e|\u5145|\u6155|\u8fde|\u8339|\u4e60|\u5ba6|\u827e|\u9c7c|\u5bb9|\u5411|\u53e4|\u6613|\u614e|\u6208|\u5ed6|\u5ebe|\u7ec8|\u66a8|\u5c45|\u8861|\u6b65|\u90fd|\u803f|\u6ee1|\u5f18|\u5321|\u56fd|\u6587|\u5bc7|\u5e7f|\u7984|\u9619|\u4e1c|\u6b27|\u6bb3|\u6c83|\u5229|\u851a|\u8d8a|\u5914|\u9686|\u5e08|\u5de9|\u538d|\u8042|\u6641|\u52fe|\u6556|\u878d|\u51b7|\u8a3e|\u8f9b|\u961a|\u90a3|\u7b80|\u9976|\u7a7a|\u66fe|\u6bcb|\u6c99|\u4e5c|\u517b|\u97a0|\u987b|\u4e30|\u5de2|\u5173|\u84af|\u76f8|\u67e5|\u540e|\u8346|\u7ea2|\u6e38|\u7afa|\u6743|\u9011|\u76d6|\u76ca|\u6853|\u516c|\u4e07\u4fdf|\u53f8\u9a6c|\u4e0a\u5b98|\u6b27\u9633|\u590f\u4faf|\u8bf8\u845b|\u95fb\u4eba|\u4e1c\u65b9|\u8d6b\u8fde|\u7687\u752b|\u5c09\u8fdf|\u516c\u7f8a|\u6fb9\u53f0|\u516c\u51b6|\u5b97\u653f|\u6fee\u9633|\u6df3\u4e8e|\u5355\u4e8e|\u592a\u53d4|\u7533\u5c60|\u516c\u5b59|\u4ef2\u5b59|\u8f69\u8f95|\u4ee4\u72d0|\u953a\u79bb|\u5b87\u6587|\u957f\u5b59|\u6155\u5bb9|\u9c9c\u4e8e|\u95fe\u4e18|\u53f8\u5f92|\u53f8\u7a7a|\u4e0c\u5b98|\u53f8\u5bc7|\u4ec9|\u7763|\u5b50\u8f66|\u989b\u5b59|\u7aef\u6728|\u5deb\u9a6c|\u516c\u897f|\u6f06\u96d5|\u4e50\u6b63|\u58e4\u9a77|\u516c\u826f|\u62d3\u62d4|\u5939\u8c37|\u5bb0\u7236|\u8c37\u6881|\u664b|\u695a|\u960e|\u6cd5|\u6c5d|\u9122|\u6d82|\u94a6|\u6bb5\u5e72|\u767e\u91cc|\u4e1c\u90ed|\u5357\u95e8|\u547c\u5ef6|\u5f52|\u6d77|\u7f8a\u820c|\u5fae\u751f|\u5cb3|\u5e05|\u7f11|\u4ea2|\u51b5|\u540e|\u6709|\u7434|\u6881\u4e18|\u5de6\u4e18|\u4e1c\u95e8|\u897f\u95e8|\u5546|\u725f|\u4f58|\u4f74|\u4f2f|\u8d4f|\u5357\u5bab|\u58a8|\u54c8|\u8c2f|\u7b2a|\u5e74|\u7231|\u9633|\u4f5f|\u7b2c\u4e94|\u8a00|\u798f)(\w{1,1})
name=[赵|钱|孙|李|周|吴|郑|王|冯|陈|褚|卫|蒋|沈|韩|杨|朱|秦|尤|许|何|吕|施|张|孔|曹|严|华|金|魏|陶|姜|戚|谢|邹|喻|柏|水|窦|章|云|苏|潘|葛|奚|范|彭|郎|鲁|韦|昌|马|苗|凤|花|方|俞|任|袁|柳|酆|鲍|史|唐|费|廉|岑|薛|雷|贺|倪|汤|滕|殷|罗|毕|郝|邬|安|常|乐|于|时|傅|皮|卞|齐|康|伍|余|元|卜|顾|孟|平|黄|和|穆|萧|尹|姚|邵|湛|汪|祁|毛|禹|狄|米|贝|明|臧|计|伏|成|戴|谈|宋|茅|庞|熊|纪|舒|屈|项|祝|董|梁|杜|阮|蓝|闵|席|季|麻|强|贾|路|娄|危|江|童|颜|郭|梅|盛|林|刁|锺|徐|邱|骆|高|夏|蔡|田|樊|胡|凌|霍|虞|万|支|柯|昝|管|卢|莫|经|房|裘|缪|干|解|应|宗|丁|宣|贲|邓|郁|单|杭|洪|包|诸|左|石|崔|吉|钮|龚|程|嵇|邢|滑|裴|陆|荣|翁|荀|羊|於|惠|甄|麴|家|封|芮|羿|储|靳|汲|邴|糜|松|井|段|富|巫|乌|焦|巴|弓|牧|隗|山|谷|车|侯|宓|蓬|全|郗|班|仰|秋|仲|伊|宫|宁|仇|栾|暴|甘|钭|历|戎|祖|武|符|刘|景|詹|束|龙|叶|幸|司|韶|郜|黎|溥|印|宿|白|怀|蒲|邰|从|鄂|索|咸|籍|卓|蔺|屠|蒙|池|乔|阳|郁|胥|能|苍|双|闻|莘|党|翟|谭|贡|劳|逄|姬|申|扶|堵|冉|宰|郦|雍|却|桑|桂|濮|牛|寿|通|边|扈|燕|冀|浦|尚|农|温|别|庄|晏|柴|瞿|充|慕|连|茹|习|宦|艾|鱼|容|向|古|易|慎|戈|廖|庾|终|暨|居|衡|步|都|耿|满|弘|匡|国|文|寇|广|禄|阙|东|欧|沃|利|蔚|越|夔|隆|师|巩|厍|聂|晁|勾|敖|融|冷|訾|辛|阚|那|简|饶|空|曾|毋|沙|乜|养|鞠|须|丰|巢|关|蒯|相|荆|红|游|竺|权|司马|上官|欧阳|夏侯|诸葛|闻人|东方|赫连|皇甫|尉迟|公羊|澹台|公冶宗政|濮阳|淳于|单于|太叔|申屠|公孙|仲孙|轩辕|令狐|钟离|宇文|长孙|慕容|司徒|司空|召|有|舜|岳|黄辰|寸|贰|皇|侨|彤|竭|端|赫|实|甫|集|象|翠|狂|辟|典|良|函|芒|苦|其|京|中|夕|乌孙|完颜|富察|费莫|蹇|称|诺|来|多|繁|戊|朴|回|毓|鉏|税|荤|靖|绪|愈|硕|牢|买|但|巧|枚|撒|泰|秘|亥|绍|以|壬|森|斋|释|奕|姒|朋|求|羽|用|占|真|穰|翦|闾|漆|贵|代|贯|旁|崇|栋|告|休|褒|谏|锐|皋|闳|在|歧|禾|示|是|委|钊|频|嬴|呼|大|威|昂|律|冒|保|系|抄|定|化|莱|校|么|抗|祢|綦|悟|宏|功|庚|务|敏|捷|拱|兆|丑|丙|畅|苟|随|类|卯|俟|友|答|乙|允|甲|留|尾|佼|玄|乘|裔|延|植|环|矫|赛|昔|侍|度|旷|遇|偶|前|由|咎|塞|敛|受|泷|袭|衅|叔|圣|御|夫|仆|镇|藩|邸|府|掌|首|员|焉|戏|可|智|尔|凭|悉|进|笃|厚|仁|业|肇|资|合|仍|九|衷|哀|刑|俎|仵|圭|夷|徭|蛮|汗|孛|乾|帖|罕|洛|淦|洋|邶|郸|郯|邗|邛|剑|虢|隋|蒿|茆|菅|苌|树|桐|锁|钟|机|盘|铎|斛|玉|线|针|箕|庹|绳|磨|蒉|瓮|弭|刀|疏|牵|浑|恽|势|世|仝|同|蚁|止|戢|睢|冼|种|涂|肖|己|泣|潜|卷|脱|谬|蹉|赧|浮|顿|说|次|错|念|夙|斯|完|丹|表|聊|源|姓|吾|寻|展|出|不|户|闭|才|无|书|学|愚|本|性|雪|霜|烟|寒|少|字|桥|板|斐|独|千|诗|嘉|扬|善|揭|祈|析|赤|紫|青|柔|刚|奇|拜|佛|陀|弥|阿|素|长|僧|隐|仙|隽|宇|祭|酒|淡|塔|琦|闪|始|星|南|天|接|波|碧|速|禚|腾|潮|镜|似|澄|潭|謇|纵|渠|奈|风|春|濯|沐|茂|英|兰|檀|藤|枝|检|生|折|登|驹|骑|貊|虎|肥|鹿|雀|野|禽|飞|节|宜|鲜|粟|栗|豆|帛|官|布|衣|藏|宝|钞|银|门|盈|庆|喜|及|普|建|营|巨|望|希|道|载|声|漫|犁|力|贸|勤|革|改|兴|亓|睦|修|信|闽|北|守|坚|勇|汉|练|尉|士|旅|五|令|将|旗|军|行|奉|敬|恭|仪|母|堂|丘|义|礼|慈|孝|理|伦|卿|问|永|辉|位|让|尧|依|犹|介|承|市|所|苑|杞|剧|第|零|谌|招|续|达|忻|六|鄞|战|迟|候|宛|励|粘|萨|邝|覃|辜|初|楼|城|区|局|台|原|考|妫|纳|泉|老|清|德|卑|过|麦|曲|竹|百|福|言|第五|佟|爱|年|笪|谯|哈|墨|连|南宫|赏|伯|佴|佘|牟|商|西门|东门|左丘|梁丘|琴|后|况|亢|缑|帅|微生|羊舌|海|归|呼延|南门|东郭|百里|钦|鄢|汝|法|闫|楚|晋|谷梁|宰父|夹谷|拓跋|壤驷|乐正|漆雕|公西|巫马|端木|颛孙|子车|督|仉|司寇|亓官|三小|鲜于|锺离|盖|逯|库|郏|逢|阴|薄|厉|稽|闾丘|公良|段干|开|光|操|瑞|眭|泥|运|摩|伟|铁|迮][\u4e00-\u9fa5]
# 手机号正则
mobile=((\+|00)86)?((134\d{4})|((13[0-3|5-9]|14[1|5-9]|15[0-9]|16[2|5|6|7]|17[0-8]|18[0-9]|19[0-2|5-9])\d{8}))
# 电话号码正则
phone=((((010)|(0[2-9]\d{1,2}))[-\s]?)[1-9]\d{6,7}$)|((\+?0?86\-?)?1[3|4|5|7|8][0-9]\d{8}$)
phone=0\d{2,3}-[1-9]\d{6,7}
# 邮箱正则
email=([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{1,4}){1,4})
# 身份证号码正则
id=[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}
id=[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]|[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}
# 银行卡号
bank_card=(([13-79]\d{3})|(2[1-9]\d{2})|(20[3-9]\d)|(8[01-79]\d{2}))\s?\d{4}\s?\d{4}\s?\d{4}(\s?\d{3})?$
bank_card=(([13-79]\d{3})|(2[1-9]\d{2})|(20[3-9]\d)|(8[01-79]\d{2}))\s?\d{4}\s?\d{4}\s?\d{4}(\s?\d{3})?
# 家庭住址正则
address=([\u4E00-\u9FA5A-Za-z0-9_]+(省|市|自治区|自治州|区|县|镇|道|路|街|号|弄|条|室)){1,}
# ip地址正则
ip=((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)
# mac地址正则
mac=[A-F0-9]{2}([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})$
\ No newline at end of file
mac=[A-F0-9]{2}([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})([-:.]?[A-F0-9]{2})([-:]?[A-F0-9]{2})
\ No newline at end of file
  • SonarQube analysis reported 109 issues

    • 🚫 24 critical
    • 59 major
    • 🔽 25 minor
    • 1 info

    Watch the comments in this conversation to review them.

    Top 30 extra issues

    Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:

    1. 🚫 Add a default case to this switch. 📘
    2. 🚫 switch中每个case需要通过break/return等来终止 📘
    3. 🚫 switch块缺少default语句 📘
    4. 🚫 Define a constant instead of duplicating this literal " {\n" 11 times. 📘
    5. 🚫 [Define a constant instead of duplicating this literal " "type": \n" 11 times. 📘
    6. 🚫 Define a constant instead of duplicating this literal " "string",\n" 6 times. 📘
    7. 🚫 Define a constant instead of duplicating this literal " "null"\n" 6 times. 📘
    8. 🚫 [Define a constant instead of duplicating this literal " ]\n" 11 times.](https://git.zorkdata.com/liaomingtao/transaction_log_desensitization/blob/6c6c5f1650a1a31c6da79d1950d40e2a59e8b61f/src/main/java/com/zorkdata/desensitization/avro/AvroSchemaDef.java#L23) 📘
    9. 🚫 Define a constant instead of duplicating this literal " },\n" 9 times. 📘
    10. 🚫 Define a constant instead of duplicating this literal " "null",\n" 5 times. 📘
    11. 🚫 Define a constant instead of duplicating this literal " {\n" 5 times. 📘
    12. 🚫 Define a constant instead of duplicating this literal " "type": "map",\n" 5 times. 📘
    13. 🚫 Define a constant instead of duplicating this literal " "values": "string"\n" 3 times. 📘
    14. 🚫 Define a constant instead of duplicating this literal " }\n" 5 times. 📘
    15. 🚫 Define a constant instead of duplicating this literal "序列化失败" 13 times. 📘
    16. 🚫 Refactor this method to reduce its Cognitive Complexity from 22 to the 15 allowed. 📘
    17. 🚫 Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation. 📘
    18. 🚫 Change this "try" to a try-with-resources. (sonar.java.source not set. Assuming 7 or greater.) 📘
    19. 🚫 Refactor this code to not throw exceptions in finally blocks. 📘
    20. 🚫 Refactor this code to not throw exceptions in finally blocks. 📘
    21. 🚫 Change this "try" to a try-with-resources. (sonar.java.source not set. Assuming 7 or greater.) 📘
    22. This block of commented-out lines of code should be removed. 📘
    23. 及时清理不再使用的代码段或配置信息。 📘
    24. Replace this use of System.out or System.err by a logger. 📘
    25. Replace this use of System.out or System.err by a logger. 📘
    26. String contains no format specifiers. 📘
    27. Replace this use of System.out or System.err by a logger. 📘
    28. Replace this use of System.out or System.err by a logger. 📘
    29. Rename "jsonObject" which hides the field declared at line 39. 📘
    30. Remove this expression which always evaluates to "true" 📘
    • ... 70 more
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment