Write a regex pattern, set flags, and test against a string with real-time match highlighting and group extraction.