Find consecutive letters in a string using regex [JS]

find consecutive letters in a string:

console.log('aaaa bbbbb cccccc dd'.match(/([a-z])\1{3,}/g));
// ["aaaa", "bbbbb", "cccccc"]
// using \1 to refer to matched content in the first parentheses

猜你喜欢

转载自blog.csdn.net/u014510460/article/details/82448602