regex - more than 10 characters

前端 未结 2 577
遇见更好的自我
遇见更好的自我 2021-01-15 10:50

How do you indicate a regex that you want to require more than 10 characters? I know that \'*\' is more than 0, and that \'+\' is more than 1 but what is syntax for requir

相关标签:
2条回答
  • 2021-01-15 11:24

    You use brace notation. For instance, the regex a{10,} would match 10 or more a characters. a{10,20} would match at least 10 and no more than 20 as.

    0 讨论(0)
  • 2021-01-15 11:42

    It depends on what your regex looks like, but this probably will work:

    [^stuff]{10,}
    
    • {10,} matches at least 10.
    • {,10} matches at most 10.
    • {10,15} matches between 10 and 15.
    0 讨论(0)
提交回复
热议问题