Test, validate and match regular expressions
This regex matches inline LaTeX blocks delimited by {tex ... } (with a word boundary after 'tex'). It captures the full content, including nested curly braces, using recursive subpattern (?R) to handle arbitrary depth. Useful for extracting LaTeX snippets embedded in markup or custom templating systems where inline math is wrapped in a {tex ... } tag. The 'gm' flags allow matching across multiple lines, making it robust for multi-line expressions.