Re: [code] Find panel, $ ^ Regexp

From: Mitchell <m.att.foicica.com>
Date: Sun, 11 Dec 2016 16:51:01 -0500 (EST)

Hi David,

On Sun, 11 Dec 2016, David Reimer wrote:

> I think there is a solution to Olivier's regex scenario.
>
> To add characters at the end of a "line" (= paragraph?) in TextAdept 9:
>
> 1. Make sure "Regex" is checked;
> 2. In "Find" put `(.)$`
> 3. In "Replace" put `\1newstring`
> 4. Click "Replace all".
>
> Explanation uses Markdown backticks to demarcate raw text.
>
> In "Find": the `(.)$` finds any character as last character at EOL.
> The parentheses save that character for back-reference.
>
> In "Replace": the `\1` recalls the character saved in parentheses from
> the find and incudes it; `newstring` is the text you wish to add at
> the EOL.
>
> Works very nicely! Of course, it does *not* add the `newstring` in
> "empty lines/paragraphs". I'm still trying to work out a way to find
> and manipulate the `^$` -- if there is a workaround to this "TRE
> limitation". (Do I understand its doc rightly, that `REG_NEWLINE` can
> be compiled to overcome this?
> <http://laurikari.net/tre/documentation/regcomp/> I might be
> mistaken.)

I just wanted to jump in and say that Textadept compiles all TRE regexes
with `REG_NEWLINE`, so nothing more can be done in this regard.

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 11 Dec 2016 - 16:51:01 EST

This archive was generated by hypermail 2.2.0 : Mon 12 Dec 2016 - 06:27:00 EST