Re: [code] Find panel, $ ^ Regexp

From: Olivier Guibe <olivier.guibe.att.univ-rouen.fr>
Date: Mon, 12 Dec 2016 09:16:39 +0100

 
Dear all

Many thanks for all the answers.
Such a regexp find/replace is very unusual for me (I was trying
some Advent code in Python on free time :) ).

Now the situation is clear.

Regards
O.G.

Le Dimanche 11 Décembre 2016 22:51 CET, Mitchell <m.att.foicica.com> a écrit:
 
> 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.
>
 
 
 
 

-- 
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 Mon 12 Dec 2016 - 03:16:39 EST

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