Regex match count of characters that are separated by non-matching characters

前端 未结 3 1825
悲&欢浪女
悲&欢浪女 2020-12-17 18:46

I want to count characters, but they may be separated by characters that do not match.

Here is an example. I want to match a text that has 10 or more word-characters

3条回答
  •  借酒劲吻你
    2020-12-17 19:19

    Use a group that consumes spaces with each single word char, and count the groups:

    ^(\s*\w){10,}\s*$
    

提交回复
热议问题