Test, validate and match regular expressions
This regex matches any word character that is immediately followed by the same exact character. It uses a capturing group and a backreference inside a positive lookahead to identify consecutive duplicate letters, numbers, or underscores. It is useful for finding or highlighting repeated characters in a string without consuming the second character.