mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Not sure why there is no support for this but PCRE allows for named capturing group which can be retrieved easily with the lib, I would like to see support for this.

Code:
//noop $regex(myreg,let's capture,/(?<named>capture)/) | echo -a > $regml(myreg,named)
Quote:
> capture


Named captures in PCRE cannot start with a digit.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
It would also be nice to be able to reference the named capture directly in $regsubex's substitution parameter:
Code:
//echo -a $regsubex(myreg,let's capture,/(?<named>capture)/,\k<capture>)
Quote:
let's capture

\k<name> being already supported by PCRE to create a named capture group.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
I tried this yesterday hoping it would work, but apparently not. In the end I had to resort to a cludge using a hash table with regex as items and name mappings as data.

Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
You may want to ask on this forum or on #regex on freenode, there may be a way to do what you want in a different way. But having this would be handy.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jun 2008
Posts: 6
D
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
D
Joined: Jun 2008
Posts: 6
I also support this idea.


Link Copied to Clipboard