123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package com.smppw.modaq.common.conts;
- import java.util.regex.Pattern;
- /**
- * 正则匹配表达式常量
- */
- public class PatternConsts {
- /**
- * 季度报告日期正则匹配
- */
- public static final Pattern QUARTERLY_PATTERN = Pattern.compile("(20[23]\\d)\\D*([一二三四1234])季");
- /**
- * 年度报告日期正则匹配
- */
- public static final Pattern ANNUALLY_PATTERN = Pattern.compile("(20[23]\\d)(年度|年报|年年度|年年报)?");
- /**
- * 月度报告日期正则匹配
- */
- public static Pattern MONTHLY_PATTERN = Pattern.compile("(20[23]\\d)[./年_-]*(\\d{1,2})月?");
- /**
- * 严格的年月日匹配
- */
- public static final Pattern STRICT_DAY_PATTERN = Pattern.compile("(20[23]\\d)[./年_-]*(\\d{1,2})[./月_-]*(\\d{1,2})[日号]*(?!\\d)");
- /**
- * 宽泛的日期匹配
- */
- public static final Pattern DAY_PATTERN = Pattern.compile("(20[23]\\d)[./年_-]*(\\d{1,2})[./月_-]*(\\d{1,2})[日号\\d]+");
- /**
- * 基金编码的正则表达式
- */
- public static final Pattern FUND_CODE_PATTERN = Pattern.compile("S[A-Z0-9]{5}");
- public static final Pattern PUB_FUND_CODE_PATTERN = Pattern.compile("^[0-9]{6}$");
- /**
- * 分级基金级别正则匹配
- */
- public static final Pattern FUND_LEVEL_PATTERN = Pattern.compile("[A-F]级|基金[A-F]");
- // 正则表达式匹配单行和多行注释
- public static final Pattern JSON_COMMENT_PATTERN = Pattern.compile(
- "(\"(?:\\\\\"|[^\"])*?\")" + // 匹配双引号内的内容(避免匹配字符串内的注释符号)
- "|//.*" + // 匹配单行注释
- "|/\\*(?:.|[\\n\\r])*?\\*/", // 匹配多行注释
- Pattern.MULTILINE
- );
- }
|