AutoHotkey Community

It is currently May 27th, 2012, 8:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: January 24th, 2012, 10:37 am 
the manual wrote:
If StartingPosition is beyond the length of Haystack, the search starts at the empty string that lies at the end of Haystack (which typically results in no match).
Code:
msgbox % RegexMatch("test", "t", m, 5)      ;returns 0, meaning not found
msgbox % RegexMatch("test", ".", m, 5)      ;returns 0, meaning not found
msgbox % RegexMatch("test", ".*", m, 5)      ;returns 5
I think the last one should yield 0.

So instead of starting searching at the empty string, why not always return 0 when the starting position exceeds the haystack length? I got this problem when I was writing a custom regex function.

Thanks for your consideration.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 11 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