AutoHotkey Community

It is currently May 27th, 2012, 10:01 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: January 10th, 2009, 9:17 pm 
Offline

Joined: November 24th, 2007, 9:07 pm
Posts: 774
Update: Wait, I think it's the way I'm escaping the quotes. Should I be using """" instead?

Why am I getting this error?

Code:
If RegExMatch(Line, "^\s*([`"[^`"]+`"|[A-Za-z0-9]+])\s*$", Match) and Not SubArray {
   FileReadLine, NextLine, %SchemeFile%,% A_Index+1
   NextLine = %NextLine%
   If (NextLine = "{") {
      SubArray := Steam_ImportSchemeArray(A_Index+1, _SchemeFile)
      If SubArray and Match1
         Items := SA_Set(Items, SubArray, Match1)
      EndLine := ErrorLevel
   } Else SubArray := false
   If Not SubArray {
      Result := RegExMatch(Line, "(`"([^`"]+)`"|([A-Za-z0-9]+))\s+([`"[^`"]+`"|[A-Za-z0-9]+])", Match)
      If Match1 {
         If Not Match2
            Match2 := ""
         Items := SA_Set(Items, Match2, Match1)
      }
   }
}


Simply running the script as is like that returns:
---------------------------
test.ahk
---------------------------
Error at line 1.

Line Text: \s
Error: The leftmost character above is illegal in an expression.

The program will exit.
---------------------------
OK
---------------------------

Am I calling it wrong? I'm looking at the manual page now but I'm not sure.

_________________
Ben

My Trac projects
My Wiki
[Broken] - My music


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2009, 10:27 pm 
Offline

Joined: November 2nd, 2004, 2:43 pm
Posts: 1019
Location: London, UK
Code:
RegExMatch(Line, "^\s*([""[^""]+""|[A-Za-z0-9]+])\s*$", Match)
Code:
Result := RegExMatch(Line, "(""([^""]+)""|([A-Za-z0-9]+))\s+([""[^""]+""|[A-Za-z0-9]+])", Match)


try that. If you haven't already.

_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2009, 10:40 pm 
Offline

Joined: November 24th, 2007, 9:07 pm
Posts: 774
Thank you, I knew it was those dang quotes :)

_________________
Ben

My Trac projects
My Wiki
[Broken] - My music


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher, specter333, tomoe_uehara, XstatyK and 63 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group