mudlet-makers team mailing list archive
-
mudlet-makers team
-
Mailing list archive
-
Message #00381
[Bug 368708] Re: matches, multimatches, selectCaptureGroup Documentation
You're right it's all working as described, except this one part here
This table is being used by Mudlet in the context of multiline triggers
that use Perl regular expression. It holds the table matches[n] as
described above for each Perl regular expression based condition of the
multiline trigger. multimatches[5][4] may hold the 4th capture group of
the 5th regex in the multiline trigger. This way you can examine and
process all relevant data within a single script. Have a look at this
example.
multimatches[5][5] is what will hold the 4th capture group. My mistake
on the other things mentioned.
--
matches, multimatches, selectCaptureGroup Documentation
https://bugs.launchpad.net/bugs/368708
You received this bug notification because you are a member of Mudlet
Makers, which is subscribed to Mudlet.
Status in Mudlet the MUD client: New
Bug description:
There appears to be a slight discrepancy in the documentation for these (and others that deal with capture groups). For ^(\d+)h, the (\d+) is documented to be matches[1], but it is not, it is matches[2]. matches[1] is the entire line, I believe. This filters down to all the different capture groups - even with the multimatches, the first group in the first regex pattern is not multimatches[1][2], it is multimatches[2][2]. Basically, you need to add 1 to the value expected by the documentation.
References