AHK V2: match object: backreference name as key?

Discuss the future of the AutoHotkey language
SAbboushi
Posts: 137
Joined: 08 Dec 2014, 22:13

AHK V2: match object: backreference name as key?

02 Aug 2018, 15:06

Is there a way to get match object keys to be the backreference names instead of backreference numbers, or is that a feature request?
User avatar
jeeswg
Posts: 5286
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AHK V2: match object: backreference name as key?

02 Aug 2018, 15:15

I had an AHK v1 example here, which I've converted to AHK v2:
jeeswg's RegEx tutorial (RegExMatch, RegExReplace) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=28031

Code: Select all

q::
RegExMatch(A_Now, "^(?P<Year>\d{4})(?P<Month>\d{2})(?P<Day>\d{2})", oMatch)
MsgBox(oMatch.Year " " oMatch.Month " " oMatch.Day)
return
Is that what you want?

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 5 guests