Test, validate and match regular expressions
This regex matches a translation function call, specifically capturing the string key and a specific flag argument. It looks for the exact syntax translate('...', flags: g), extracting the string value inside the quotes into the first group and the flag definition into the second. It is useful for static analysis tools or internationalization (i18n) scripts that need to parse source code and extract translation keys with specific configurations.