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

22162Re: [Clip] Re: A little help on look behinds

Expand Messages
  • Sheri
    Oct 16, 2011
    • 0 Attachment
      On 10/16/2011 2:26 PM, diodeom wrote:
      >
      >
      > I'd guess you're running this pattern in the (Ctrl+R) dialog box instead of in a clip -- where it's meant to ***capture or fail*** only once (on the very first instance of either [[[ or ]]]).
      >
      > If you click "Find Next" after #5 and #7, notice that your beginning position for the next attempt is on or after line #7. After the first available alternative "[[[" is spotted by the look-ahead now on line #9, (*COMMIT) demands that at this very location either "]]]" should be found or else the whole pattern should abandon any further matching attempts. Obviously, "[[[" ain't the required "]]]" so the pattern fails by design.
      >
      >
      >

      Hi Dio, Flo, everyone,

      That seems to say it well Dio.

      In retrospect, this is likely sufficient:

      ^!Replace "^(?=\Q]]]\E|\Q[[[\E)(*COMMIT)\Q]]]\E.*\R" >> "" WRS

      if the "A" (replace all) option were added, it would remove both
      "remove" lines from Flo's sample and quit upon seeing a line that begins
      with [[[

      I agree that the PCRE (*VERB) documentation is poor. In addition it
      should be noted that there have been bug fixes and enhancements to verb
      processing in the three PCRE updates that have occurred since the
      version built into NoteTab 6.2.

      Yet another PCRE update is pending (PCRE 8.20) and I hope Eric will take
      note when its available.

      That said, the best way to understand what the verbs do is to experiment
      with them.

      Regards,
      Sheri
    • Show all 21 messages in this topic