Test, validate and match regular expressions
This regex identifies duplicate words in text by capturing each word and using a positive lookahead to check if the same word (via backreference \1) appears again later in the text. The word boundaries ensure complete word matches. Useful for finding repeated words in content analysis, document review, or data cleaning tasks. The global (g) flag finds all matches while multiline (m) handles multiple lines.