跳转到主要内容
NameConventional designationUsage example
名称常规表示法使用示例
任意字符*"c"*"t" – 允许 cat、cot 等单词。
字母CC"ot" – 允许 Rot、pot、cot、Dot、mot 等单词。
大写字母AA"ot" – 允许 Rot、Cot、Mot、Dot 等单词。
小写字母aa"ot" – 允许 rot、cot、mot、dot 等单词。
字母或数字XX – 允许任何单独的数字或字母。
数字NN"th" 允许 5th、4th、6th 等单词。
字符串" ""cot"
```“pl”(“o""a”)“t”` – 允许 “plot” 和 “plat” 这两个单词。
组中的字符[][tm]"ot" – 允许 “tot” 和 “mot” 这两个单词。
不在组中的字符[^][^t]"ot" – 允许 “cot”、“lot” 等单词,但不允许 “tot”。
空格 (组内)\s[A\s] 仅允许字母 A 或空格。
任意重复次数 (应用于左侧的表达式或子表达式){-}[AB74]{-} – 允许由字符 A、B、7、4 组成的任意长度组合。
重复 n 次{n}N{2}"th" 允许 25th、84th、11th 等单词。
重复 n 到 m 次{n-m}N{1-3}"th" 允许 5th、84th、111th 等单词。
重复 0 到 n 次{-n}N{-2}"th" 允许 84th、5th 等单词。
重复 n 次及以上{n-}N{2-}"th" 允许 25th、834th、311th、34576th 等单词。
子表达式()
连字符符号[\-]
反斜杠符号[\\]

正则表达式示例

  1. 邮政编码:[0-9]{6} 示例值:“142172”
  2. 邮编 (USA) :[0-9]{5}("-"[0-9]{4}){-1} 示例值:“55416”、“33701-4313”
  3. 收入:N{4-8}[,]N{2} 示例值:“15000,00”、“4499,00”
  4. 数字形式的月份:((|"0")[1-9])|("10")|("11")|("12") 示例值:“4”、“05”、“12”
  5. 分数 (小数) :("-"|)([0-9]{1-})(|((".",")([0-9]{1-}))) 示例值:“1234,567”、“0.99”、“100,0”、“-345.6788903”
  6. 电子邮件地址:[A-Za-z0-9_]{1-}((".""-")[A-Za-z0-9_]{1-}){-3}"@"[A-Za-z0-9_]{1-}((".""-")[A-Za-z0-9_]{1-}){-4}"."([A-Za-z]{2-4}|"asia"|"museum"|"travel"|"example"|"localhost") 示例值:“support@abbyy.com”、“my-name@company.org.ru”、“info@gallery.museum