Matching the same word twice with a regular expression, not caring what the word is
Try this:
/(\w+)\.\1/g
Tested on http://regexpal.com/ and works.
Edit: added global modifier like TomTom correctly suggests.
Should be with global!
/(\w+)\.\1/g;