One of the trying things about regular expression capture groups is having to iterate through an array of $regml() and $regmlex() results and tediously dump them into %variables. This can take up a rather bulky amount of code the more complex a pattern gets with more items you wish to capture.

I would like to propose adding support for PCRE's named capture groups, and translate that capture information directly into local variables. Examples:

Named Capture Group Regex Syntax

Code:
noop $regex(string,/(?<foo>.*)/)   (PCRE 7+)
noop $regex(string,/(?'foo'.*)/)   (PCRE 7+)
noop $regex(string,/(?P<foo>.*)/)  (PCRE old)

compared to

noop $regex(string,/(.*)/)

In the 3 above examples, the local variable %foo would be defined and populated with the captured string.

$regml/ex() would not be necessary to retrieve the data.

(For those keeping score, there's no necessary change to what regex patterns mIRC supports or backwards compatibility, since PCRE already handles and interprets all of this on its own. mIRC just doesn't make use of it at this time.)


Well. At least I won lunch.
Good philosophy, see good in bad, I like!