Re: [code] [textadept] search/regexp

From: Mitchell <m.att.foicica.com>
Date: Sun, 27 Oct 2013 13:00:11 -0400 (EDT)

Hi Dirk,

On Sun, 27 Oct 2013, Dirk GŁnther wrote:

> 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?

Are you running the latest beta? If so, its `buffer.FIND_REGEXP` flag is
broken. There is a fix in hg's `core/iface.lua` file.

Cheers,
Mitchell

-- 
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 - 13:00:11 EDT

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