Skip to content

selectCaptureGroup() enhancement to support named captures #5107

@Serity

Description

@Serity

Description of requested feature:

https://wiki.mudlet.org/w/Manual:Lua_Functions#selectCaptureGroup

Currently only supports integers that match "matches[#]". Should now support selectCaptureGroup('health') etc.

Reasons for adding feature:

Consistency with the reasoning for implementing named capture groups to begin with (to make it easier to code when dealing with multiple triggers with different layouts with the same information).

Expected result of feature

^(?<player_name>\w+)'s HP: (?<hp>\d+)/(?<maxhp>\d+)$
^\(Status: (?<hp>\d+)/(?<maxhp>\d+)hp\)$
selectCaptureGroup("hp") -- should be usable to select the 'hp' group
-- modification, replacement, deletion, whatever...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions