Re: [code] textadept regexp matching

From: tastyminerals <tastyminerals.att.gmail.com>
Date: Wed, 07 May 2014 14:53:55 +0300

I see, thanks for the ta-regex link, that should be extremely helpful.
I wonder why it's not included in ta and mentioned on the main site.

Regards,
Pavel

On 5/7/2014 2:49 PM, Chris Emerson wrote:
> Hi Pavel,
>
> On Wed, May 07, 2014 at 02:18:26PM +0300, tastyminerals wrote:
>> I am trying to match "matched - 0" string with the following lua
>> pattern: matched%s-%s0.
>> I know that the example string contains exactly whitespaces, but the
>> match is not happening.
>>
>> 1. What am I doing wrong?
> The problem is that '-' is a Lua pattern metacharacter, so you need to
> escape it. Try: matched%s%-%s0 .
>
>> 2. What is the equivalent of ^[^word]*$ in lua patterns?
> If I understand correctly, it's the same.
>
>> 3. I've read appendix on lua patterns and became disappointed, lua
>> patterns seem to lack functionality of regular regexps, is that the
>> case?
> That's correct, Lua patterns are not as powerful as regexps.
>
> That annoys me too, so I implemented regexes for TA, in case that's of any
> use to you:
>
> https://github.com/jugglerchris/ta-regex
>
> Regards,
>
> 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.
Received on Wed 07 May 2014 - 07:53:55 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 May 2014 - 06:26:17 EDT