Loading ...
Sorry, an error occurred while loading the content.

22396Re: [NTB] Regular Expression: find between two words

Expand Messages
  • Eb
    Feb 29, 2012
    • 0 Attachment

      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 notetab@yahoogroups.com, "flo.gehrke" <flo.gehrke@...> wrote:
      > --- In notetab@yahoogroups.com, "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 notetab@yahoogroups.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 "
    • Show all 15 messages in this topic