How to find all words with 3 same, consecutive letters with RegEx? -


i have text, lets say:

ich gehe auf die donau und mache eine tolle schifffahrt während ich nussschalen esse.

so now, want find words 3 same, consecutive letters in it. in case be:

schifffahrt

and

nussschale

i don't have lot of experience in regex, appreciate help. opened regex101 page you.

thank much. (for want know why need strange: reason words 3 same letter in because rare. thouhgt program bot requesting websites, reading content, , saves , outputs found words 3 same letters in it. nice, isn't it? :))

you can use regex:

\b\w*(\w)\1\1\w* 

regex demo

regex breakup:

\b    # word boundary \w*   # match 0 more word chars \w    # match word char , capture group #1 \1\1  # match 2 more instances of group #1 \w*   # match 0 more word chars 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -