Test, validate and match regular expressions
This regular expression matches function or method declarations in LScript (or similar C-like syntax), capturing the access modifier (private/public), name, arguments, and the body enclosed in curly braces. It is specifically designed for parsing source code to extract structural definitions and could be used in static code analysis tools, documentation generators, or IDE extensions. The 'gm' flags allow it to find multiple matches across a multiline string.