[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-devel
Subject:    Re: [LyX/master] FindAdv: Optimization
From:       Kornel Benko <kornel () lyx ! org>
Date:       2018-11-25 21:00:18
Message-ID: 1750444.PBOpjWKl8U () amd64
[Download RAW message or body]


Am Sonntag, 25. November 2018 15:12:38 CET schrieb Scott Kostyshak \
<skostysh@lyx.org>:
> On Sun, Nov 25, 2018 at 06:14:11PM +0100, Kornel Benko wrote:
> > Am Samstag, 24. November 2018 20:58:25 CET schrieb Scott Kostyshak \
> > <skostysh@lyx.org>:
> > > On Sun, Nov 25, 2018 at 12:46:35AM +0100, Kornel Benko wrote:
> > > > Am Samstag, 24. November 2018 16:07:29 CET schrieb Scott Kostyshak \
> > > > <skostysh@lyx.org>:
> > > > > On Sat, Nov 24, 2018 at 08:41:23PM +0100, Kornel Benko wrote:
> > > > > 
> > > > > > Given a string
> > > > > > 	"xxx regular expression some other text expression"
> > > > > > and a pattern
> > > > > > 	"regular.*expres"
> > > > > > 
> > > > > > The question now: what should be found?
> > > > > > 1.)	"regular expres"
> > > > > > or
> > > > > > 2.) "regular expression some other text expres"
> > > > > > 
> > > > > > The '.*' in regex is greedy.
> > > > > 
> > > > > Agreed. I expected a greedy match.
> > > > 
> > > > OK, I try to create a patch.
> > > 
> > > Thanks.
> > 
> > Committed at e96a9d6.
> > 
> > > > > I wasn't sure whether to expect a
> > > > > greedy match within paragraphs or across paragraphs.
> > > > 
> > > > Only inside a paragraph/inset, because the entity we have to handle does not \
> > > > exceed the boundaries. 
> > > > Anyway, if one would want to 'ungreed', there will always exist the \
> > > > possibility to use (in our case)  "regular.*?expres"
> > > 
> > > OK good to know.
> > 
> > There were problems to get regex and 'whole_words' to work together.
> > Still some special cases may lead to wrong selection (for instance inside math \
> > macros).
> 
> Thanks, tested and looks good. Now I get the attached output. From what
> I understand, as long as there is a match anywhere inside the footnote,
> the entire footnote is selected. I think that makes sense and can't
> think of an alternative (since we do not allow for selection outside an
> inset and partial selection inside).

Exactly. That would be my explanation too. The search finds the correct end, but the \
select creation includes the complete footnote.

> Scott

	Kornel


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic