RegexMatch giving "compile error 14 at offset" "missing"

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mstrauss2021
Posts: 30
Joined: 13 Feb 2021, 10:34

RegexMatch giving "compile error 14 at offset" "missing"

17 May 2021, 20:08

I have been using AHK for several months and am getting quite good at it.
I recently have been working with regexmatch for reading nfo files and everything was working smooth until today.
I read from the file directly which is 3K, but here is a substring which includes the needle
Part of haystack:
<tagline>Everyone&apos;s getting smoked</tagline>
<runtime>95</runtime>
<thumb aspect="poster" preview="http://image.tmdb.org/t/p/w500/auQHgr1FO6upJpXx1eYEeyq2sMs.jpg">http://image.tmdb.org/t/p/original/auQHgr1FO6upJpXx1eYEeyq2sMs.jpg</thumb>
<thumb aspect="poster" preview="http://image.tmdb.org/t/p/w500/6oGHH27nqaLGfpcgYRIZYSJs7AD.jpg">http://image.tmdb.org/t/p/original/6oGHH27nqaLGfpcgYRIZYSJs7AD.jpg</thumb>


Needle I am looking for: http://image.tmdb.org/t/p/w500/auQHgr1FO6upJpXx1eYEeyq2sMs.jpg

Code:

Code: Select all

regexmatch(Data, "(<thumb aspect=""poster"" preview=""")(.*?)(?=">)", results)
MsgBox Error: %ErrorLevel%
Msg reads: "compile error 14 at offset"...."missing"

I've had errors before and have been able to solve them, but this one is very unusual.

Any thoughts?

Thanks

Mike

Sorry, I keep seeing in the preview that the url link I am looking for keeps messing up.
It is removing the : after the // after http
Last edited by gregster on 17 May 2021, 21:53, edited 2 times in total.
Reason: Topic moved to 'Ask For Help' (v1).
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: RegexMatch giving "compile error 14 at offset" "missing"

17 May 2021, 20:37

not a v2 topic

it should be obvious whats wrong, unless u arent using any syntax highlighters(in which case, why arent u?)
image.png
image.png (3.69 KiB) Viewed 346 times
bad ahk escaping of double quotes. ur pattern(disregarding the garbage that follows) evaluates to (<thumb aspect="poster" preview=", which indeed is a malformed pcre pattern missing a closing paren
mstrauss2021
Posts: 30
Joined: 13 Feb 2021, 10:34

Re: RegexMatch giving "compile error 14 at offset" "missing"

02 Jun 2021, 15:32

Thanks for the reply. Stupid mistake by me.

Job is working me too hard nd effecting my brain.

As for where to post, it may be obious to most, but even after you said it is not a v2 topic, I have no idea where I should have posted this issue.

Thanks again
gregster
Posts: 9001
Joined: 30 Sep 2013, 06:48

Re: RegexMatch giving "compile error 14 at offset" "missing"

02 Jun 2021, 16:49

mstrauss2021 wrote:
02 Jun 2021, 15:32
but even after you said it is not a v2 topic, I have no idea where I should have posted this issue.
Well, the regular 'Ask For Help' subforum would have been correct for your AHK v1 code (v1 still being the main release) - that's where it is now (since 18 May 2021 to be exact, in my timezone at least - see my edit comment in your first post above).

To be clear, you posted this topic originally in the AutoHotkey v2 Help subforum.
(AHK v2 (alpha) introduced a number of breaking syntax changes.)
Don't worry, it's no biggie.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: aitaixy, Joey5 and 246 guests