variable in RegexMatch Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
zuzu_kuc
Posts: 76
Joined: 30 Mar 2016, 12:36

variable in RegexMatch

07 Aug 2019, 07:43

hi,
i found some topics but i dont understand (newbie), so i try explain my problem:
I have excel with models
SE2219H
SE2216H
S2319H

part of my code:

Code: Select all

clipboard =
	send, ^c
	ClipWait
	sleep, 150
	model = %clipboard%
	
then i get text from website and on that website im looking for url contains my model wich is in variable "model" so i have to find this:

<a href="/dell-se2216h-led-monitor-22/181293/produkt"
i can do that with:

Code: Select all

geMyUrl := regexMatch(myWebSite, "a href=./dell.+/produkt.", FinalUrl)
so how can i use my variable "model" with regex? I know this is not working:

Code: Select all

geMyUrl := regexMatch(myWebSite, "a href=./dell.+" model  ".+/produkt."", FinalUrl)

Code: Select all

geMyUrl := regexMatch(myWebSite, "a href=./dell.+" %model%  ".+/produkt."", FinalUrl)
thanx a LOT!
User avatar
Sir Teddy the First
Posts: 94
Joined: 05 Aug 2019, 12:31
Contact:

Re: variable in RegexMatch  Topic is solved

07 Aug 2019, 07:52

Hi,
this works for me:

Code: Select all

RegExMatch(myWebSite, "a href=./dell.+" model ".+/produkt." , FinalUrl)
Keep in mind that the Output-String is in "FinalUrl", the "getMyUrl" in your code would only contain the position of the found string.
You don't need anything before the "RegExMatch", just if you want to know the position.
:eh: :think:
zuzu_kuc
Posts: 76
Joined: 30 Mar 2016, 12:36

Re: variable in RegexMatch

07 Aug 2019, 10:27

Ahaa i know where was problem, if i copy something from excel i get breakline character at the end, and then regexmatch wont work. Thanks you.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ThePeter and 220 guests