What do comma separated numbers in curly braces at the end of a regex mean?

后端 未结 6 1672
北恋
北恋 2020-11-28 12:36

I am trying to understand the following regex, I understand the initial part but I\'m not able to figure out what {3,19} is doing here:

/[A-Z][A-Za-z0-9\\s]{         


        
6条回答
  •  感动是毒
    2020-11-28 13:28

    They are 'quantifiers' - it means 'match previous pattern between 3 and 19 times'

    When you are learning regular expressions, it's really use to play with them in an interactive tool which can highlight the matches. I've always liked a tool called Regex Coach, but it is Windows only. Plenty of online tools though - have a play with your regex here, for example.

提交回复
热议问题