How can I find repeated letters with a Perl regex?

后端 未结 11 1303
孤独总比滥情好
孤独总比滥情好 2020-12-09 03:18

I am looking for a regex that will find repeating letters. So any letter twice or more, for example:

booooooot or abbott

I won\'t know the

11条回答
  •  北海茫月
    2020-12-09 03:40

    I think you actually want this rather than the "\w" as that includes numbers and the underscore.

    ([a-zA-Z])\1+
    

    Ok, ok, I can take a hint Leon. Use this for the unicode-world or for posix stuff.

    ([[:alpha:]])\1+
    

提交回复
热议问题