{n,m} 有限重复

Top  Previous  Next

 

根据要求,'+' 或 '*' 字符 会尽量最多或最少地重复前一部分,还可以用 '{' 和 '}' 指定字符重复多少次。

 

 a{n}        匹配正好重复n次的'a'

 a{n,}        匹配重复n次或更多次的'a'

 a{n,m}        匹配重复n次到m次的'a'

 

例如:

 

 [0-9]{4,6}        匹配1000 到 999999 的任何数字


Copyright © 2021 Mythicsoft Ltd. All rights reserved.
Help file version: 9.0

PDF and CHM versions of this help file are available here:
http://mythicsoft.com/filelocatorpro/help