Trying to understand regex syntax in PMC

Advanced Macro Recorder/Editor.

Moderator: Pulover

jackblack2009
Posts: 2
Joined: 19 Aug 2022, 22:54

Trying to understand regex syntax in PMC

19 Aug 2022, 23:39

Hi Yall, :shock:

I have a string my macro copies to the clipboard.

Wickliffe Court 25 Wickliffe Avenue LONDON N3 3EL

Im trying to extract and store the house/street, town and Postcode in different variables.

To this end, Here I'm first trying to extract the street.

Using

https://regexr.com/

The following code seems to work.

Code: Select all

.*(?=\s[A-Z]{3,})
Spoiler
But I get an empty messge box when I run this through PMC.

Code: Select all

MsgBox, 0, , %clipboard%                                                       ---  I can see PMC has read the clipboard Ok
ex1 := RegExMatch(clipboard , ".*(?=\s[A-Z]{3,})" , varo1)        --- I must need to reformat my query because...
MsgBox, 0, , %varo1%                                                             --- No result. Empty Box.
Other basic searches work. So I feel that as I can otherwise get PMC to read the clipboard, run a search and store that result in %varo1%....

there must be something im missing re my regex code when trying to use this basic lookahead algo in PMC.

Again, it seems to work on regexr and Ive had a good look at the documentation on autohotkey....

Anyone here see / understand where im going wrong?

Kind regards everyone. Much Love. :crazy: :salute:
User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: Trying to understand regex syntax in PMC

20 Aug 2022, 08:26

Does it work when you export the script to ahk or exe?
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
jackblack2009
Posts: 2
Joined: 19 Aug 2022, 22:54

Re: Trying to understand regex syntax in PMC

20 Aug 2022, 23:02

Pulover wrote:
20 Aug 2022, 08:26
Does it work when you export the script to ahk or exe?
Ahh. Yes.

and cheers chief. loving PMC




..and creating an exe also worked.

So whats going on here then? :xmas: did i find a feature :HeHe:

Gonna have a look at the source for fun/practice but will have no idea whats going on. Ill be surprised if i can even find the code related to regex. ..and id wonder IF this behavior even had anything to do with that :roll:

thanks again dude
User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: Trying to understand regex syntax in PMC

26 Aug 2022, 06:08

There might be a bug, then. Maybe in the Eval function. You might as well open an issue on github.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)

Return to “Pulovers Macro Creator”

Who is online

Users browsing this forum: No registered users and 22 guests