Two named subpatterns having the same name - is it possible?

Posted by Cadari on Mon 30 Jun 2008 04:45 PM — 3 posts, 16,506 views.

#0
Hello! Please tell me, is there a way to make a trigger with two or more subpatters having the same name? Say, like this one:

match="^((Your (?P<side>left|right) arm is cut)|(Aha, so it was your (?P<side>left|right) arm))\.$"

Only one message will match any time the trigger fires, so there's no problem with identical names, but of course I still get:

Error "Failed: two named subpatterns have the same name at offset ... processing regular expression ..."

Any way to solve this? Thank you.

Edit: I can make it work rewriting the match string like this:

match="^((Your)|(Aha, so it was your)) (?P<side>left|right) arm (is cut|)\.$"

But maybe there's a simpler way, like a checkbox "allow indentical names" somewhere? :)
Amended on Mon 30 Jun 2008 04:52 PM by Cadari
Australia Forum Administrator #1
See: http://mushclient.com/regexp

Scroll down to: Duplicate names
#2
Sorry for not reading the help section before asking.
Thank you!