Re: [code] [textadept] Textadept 9 poll: Lua patterns or Regex?

From: Ryan Pusztai <rpusztai.att.gmail.com>
Date: Sun, 3 Jul 2016 08:26:08 -0400

I could use both. I am very familiar with Lua patterns and they do all I
need, but I understand the argument to have a generic solution for a
"programming" editor.

--
Regards,
Ryan
Sent from my phone
On Jul 3, 2016 4:17 AM, "Chris Emerson" <c-ta.att.mail.nosreme.org> wrote:
> Hi Mitchell,
>
> On Sat, Jul 02, 2016 at 11:07:10PM -0400, Mitchell wrote:
> > The question I have for you is would you prefer to have Regex
> > searches instead of Lua pattern searches?
>
> As someone who implemented regexes using LPEG so that I can use them in
> Textadept, I think this is well worth the tradeoff.  Personally I don't
> think either Lua patterns or Scintilla's not-actually-regular-expressions
> are
> good enough for a programmer's editor.  From reading the description of TRE
> (no other experience) it seems to be the right kind of RE engine for TA
> (complete and efficient).
>
> > Also, if Regex wins, I'll likely be removing the Lua code execution
> > in pattern replacements (e.g. `%(string.upper('%1')`). In the very
> > few instances I've actually used it, it's not as reliable as I'd
> > expect it to be.
>
> I've never used this, but then I don't use Textadept's search UI at all...
>
> > I'd appreciate your thoughts and comments on this very much.
>
> If this happens I'm personally all that interested in the UI end of it,
> but more the API.  The things I'm likely to want to use it for:
>
> * search for next match
> * find all non-overlapping matches
> * highlight all matches
> * match against one line (including returning captures) for implementing
> the vi "s/(.*)-(.*)/\2_\1/" type of operation.  If compiling the regex
> isn't very fast I'd ideally want to be able to re-use the same compiled
> regex each time.
>
> I'm not saying the above should all be provided directly - as long as
> the right primitives are available to Lua I'm happy.  (That's why I use
> Textadept in the first place!  :-) )
>
> Thanks,
>
> Chris
> --
> 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.
>
>
-- 
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 03 Jul 2016 - 08:26:08 EDT

This archive was generated by hypermail 2.2.0 : Mon 04 Jul 2016 - 06:42:34 EDT