Regular expression to count number of commas in a string

前端 未结 9 984
故里飘歌
故里飘歌 2020-11-27 05:23

How can I build a regular expression that will match a string of any length containing any characters but which must contain 21 commas?

9条回答
  •  失恋的感觉
    2020-11-27 06:11

    What language? There's probably a simpler method.

    For example...

    In CFML, you can just see if ListLen(MyString) is 22

    In Java, you can compare MyString.split(',') to 22

    etc...

提交回复
热议问题