How to represent a fix number of repeats in regular expression?

后端 未结 4 1622
北荒
北荒 2021-02-01 12:06

I am wondering if there is a better to represent a fix amount of repeats in a regular expression. For example, if I just want to match exactly 14 letters/digits, I am using

4条回答
  •  渐次进展
    2021-02-01 13:06

    For Java:

    Quantifiers documentation

    X, exactly n times: X{n}
    X, at least n times: X{n,}
    X, at least n but not more than m times: X{n,m}

提交回复
热议问题