Build, test, and debug regular expressions
This regex matches any text that contains the phrase 'capital of' followed by one or more characters, allowing for arbitrary content before and after. With the 'gmi' flags, it performs a global, case-insensitive search across multiple lines, making it useful for extracting sentences or fragments that mention a capital city, such as 'the capital of France is Paris'. It is ideal for parsing lists, articles, or user input where the pattern indicates a capital-related statement.