What's wrong with my RegExMatch? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Sal
Posts: 7
Joined: 14 Jan 2019, 21:18

What's wrong with my RegExMatch?

23 Jan 2019, 17:52

I know I am doing something dumb! I want to save the number below.

Code: Select all

text = (Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus id ante (59 Days) sed purus pulvinar mollis. Maecena)

RegExMatch(text, "\((\d+)(?:\sDays\))",Days)

MsgBox, The number of days is: %Days%
What have I done wrong?

Thanks
TAC109
Posts: 1111
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: What's wrong with my RegExMatch?  Topic is solved

23 Jan 2019, 18:04

In the last line of your code %days% should be %days1%. (The first sub-pattern.)
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Sal
Posts: 7
Joined: 14 Jan 2019, 21:18

Re: What's wrong with my RegExMatch?

24 Jan 2019, 00:04

Brilliant! Thanks so much.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], wpulford and 412 guests