I want to check for duplicated words right next to each other, but even if there is punctuation in between.
For example:
Vivamus Vivamus diam, diam, Vivamus Vivamus diam, diam Vivamus
There should be four distinct hits here.
I can't figure out why this isn't working. Why? What should the correct code be?
(\w*(?:[ ,\.])*?)\1
PS: This is not necessarily for the Perl engine.