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

23666Re: [Clip] Trivial clip

Expand Messages
  • Alec Burgess
    Feb 18, 2013
    • 0 Attachment
      Actually Ian, John has it correctly though I probably would have done it
      the way you suggest.
      The \K escape sequence erases anything that has been found up to the
      place it appears but leaves any previously established groups available
      for use in replacement.

      from Google [pcre escape sequence "\K"]
      http://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions
      I know what follows is somewhere(?) in Notetab - Help - Help on Regular
      Expressions but its hard to search for \K

      Look-ahead and look-behind assertions
      Patterns may assert that previous text or subsequent text contains a
      pattern without consuming matched text (zero-width assertion). For
      example, /\w+(?=\t)/ matches a word followed by a tab, without
      including the tab.
      Look-behind assertions cannot be of uncertain length.
      Since version 7.2, \K can be used in a pattern to reset the start of
      the current whole match. This provides a flexible alternative
      approach to look-behind assertions because the discarded part of the
      match (the part that precedes \K) need not be fixed in length.

      FWIW: I tested it just to be sure - if you use the Replace dialog and
      step through with [Find] you see nothing apparently selected but each
      [Replace] doubles the line. (Thx Flo, I think for finally ramming \K
      usage through my head - once grokked it can prove very useful)

      On 2013-02-18 23:19, Ian NTnerd wrote:
      > I'm no ReGex expert but shouldn't there be two $1 in the output. I think
      > it is just a typo and he meant,
      >
      > ^!Replace "^(.+)\K$" >> "$1\x20$1" ARSW
      >
      > No time to test it.
      >
      > Ian
      >
      > On 19/02/2013 7:55 AM, John Shotsky wrote:
      > >
      > > The following should do what you request:
      > > ^!Replace "^(.+)\K$" >> "\x20$1" ARSW
      --
      Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)


      [Non-text portions of this message have been removed]
    • Show all 14 messages in this topic