Obscure unmatched parantheses in While-Loop

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Obscure unmatched parantheses in While-Loop

Re: Obscure unmatched parantheses in While-Loop

Post by hoppfrosch » 16 Nov 2017, 06:47

:oops: .... missed that!

Thanks a lot for the hint!

Re: Obscure unmatched parantheses in While-Loop

Post by Helgef » 16 Nov 2017, 06:34

Remove the O option, in v2, match object is default. :wave:
Edit: Similar in v1, if you use an invalid option, say, "_)needle", errorlevel will be set to the same error, conveniently, v2 throws the error instead :thumbup:

Obscure unmatched parantheses in While-Loop

Post by hoppfrosch » 16 Nov 2017, 06:30

Hi there,

I'm trying to iterate over all matches within a string using RegExMatch within a While-Loop:

Code: [Select all]GeSHi © Codebox Plus

FoundPos := 1
len := 0
str := "aaaa aabb bbbb bbcc cccc ccbb bbbb bbaa aaaa"
pattern := "O)b{4}"

While (FoundPos := RegExMatch(str, pattern, Match, FoundPos + len))
{
MsgBox(Match[0]) ; for AHK V1 use: MsgBox % Match[0])
len := Match.len(0)
}


Running this code with AHK 1.1.26.01 everything is OK - running the same code (except the modification for MsgBox) with AHK 2.0.a081 this leds to an error:

Code: [Select all] [Expand]GeSHi © Codebox Plus



Where does the unmatched parantheses error come from?

Top