Test, validate and match regular expressions
This regular expression matches duplicate consecutive words in a string. It uses a capturing group to identify a word, followed by non-word characters (like spaces), and then a backreference to match the exact same word again. It is commonly used for text proofreading, data cleaning, or removing accidental repeated words.