[code] [textadept] search/regexp

From: Dirk GŁnther <std300.att.gmail.com>
Date: Sun, 27 Oct 2013 13:59:48 +0100

Hello,

I have a problem understanding regexp. See this function:

function foo()
local here = buffer.current_pos
        buffer:search_anchor()
local pos = buffer:search_prev(0,'b')
if pos >= 0 then
 buffer:search_anchor()
local e = buffer:search_next(buffer.FIND_REGEXP,'bar')
end
end

when I run this function in a buffer which contains the word "bar", it
works as expected (goes back to b and looks forward to find 'bar'. But when
I change the search_next function call to

local e = buffer:search_next(buffer.FIND_REGEXP,'.ar')

the word "bar" is not found (e is -1 in the second case)

I expected to have '.ar' also find the word 'bar'. What am I doing wrong?

Thanks

Dirk

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sun 27 Oct 2013 - 08:59:48 EDT

This archive was generated by hypermail 2.2.0 : Mon 28 Oct 2013 - 06:43:26 EDT