22396Re: [NTB] Regular Expression: find between two words
- Feb 29, 2012Flo,
James reports, that the expression
"(?<=word1 )[^\r\n]*(?= word2)"
fails to find " some text here "
(containing a double space on the left.
Tests on my PC confirm this bug.
Are you saying, YOUR NoteTab succeeds in finding the pattern?
That would imply the bug being INCONSISTENCY rather than regular expression handling.
On TWO of _my_ systems, NoteTab FAILS to find the double space pattern. This implies, that somewhere between finding the first space in the assertion, and the second space, NoteTab loses track of spaces.
--- In email@example.com, "flo.gehrke" <flo.gehrke@...> wrote:
> --- In firstname.lastname@example.org, "Eb" <ebbtidalflats@> wrote:
> > ... NoteTab is confused here.
> There is no "interpreting the two spaces as one" here. NT is exactly following PCRE rules: The Lookbehind is matching the first space after 'word1', and the Character Class '[^\r\n]' matches the second space following 'word1'.
> > --- In email@example.com, "book7reader" <jim@> wrote:
> > >
> > > If this is the actual target text:
> > >
> > > word1 some text here word2
> > > (?<=word1 )[^\r\n]*(?= word2)
> It does not find " some text here "
- << Previous post in topic Next post in topic >>