AHK V2: match object: backreference name as key? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
SAbboushi
Posts: 252
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: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AHK V2: match object: backreference name as key?  Topic is solved

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?
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: CraigM, redrum, sofista and 30 guests