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

22158RE: [Clip] A little help on look behinds

Expand Messages
  • John Shotsky
    Oct 16, 2011
      Thanks, Flo, the second example does what is needed. It's also easier for me to understand´┐Ż :-)


      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of flo.gehrke
      Sent: Sunday, October 16, 2011 05:25
      To: ntb-clips@yahoogroups.com
      Subject: Re: [Clip] A little help on look behinds

      --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , "John Shotsky" <jshotsky@...> wrote:
      > ...there may be, at most, one instance where ]]] is not
      > preceded anywhere in the file by a [[[. That is the only ]]] that
      > should be removed. It is always the first one...


      I think if it's always the first ']]]' in the string you could just write...

      ^!Replace "(?s).{1,}?\K\]{3}\R" >> "" WRS

      The beginning of file is asserted with the 'W' option -- so there's no '\A' necessary. Without the 'A' option, only the
      first occurrence gets removed.

      If "no instances of ([[[) [is] permitted in search" you could exclude that with a negative Lookahead...

      ^!Replace "(?s)(?!\[{3}).{1,}?\K\]{3}\R" >> "" WRS

      ...if necessary.


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