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

24126RE: [Clip] REGEX Search Backward

Expand Messages
  • John Shotsky
    Nov 2, 2013

      Thanks for the correction on the \A - of course, the W option does cause it to start at the beginning. Duh again.

      When I want to insert something at the top of the document, I often use the replace \A with my intended text, which works fine and doesn't require jumping to the top first.


      RecipeTools Web Site: http://recipetools.gotdns.com/
      John's Mags Yahoo Group:  http://groups.yahoo.com/group/johnsmags/


      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Axel Berger
      Sent: Saturday, November 02, 2013 09:34
      To: ntb-clips@yahoogroups.com
      Subject: Re: [Clip] REGEX Search Backward



      nullclip@... wrote:

      > The work-around is to put the cursor at the start of the
      > document or outline topic's text before beginning the search
      > for the last URL.

      Sorry, I can't reproduce that. So far I had only followed the thread
      without trying anything myself but I just ran John's clip on one of my
      HTMLs and it worked out of the box as advertised.

      Two small points:
      As per the help file the "A" is meaningless here, it is only applicable
      for ^!Replace. The relevant part for finding the last occurrance is the
      greedy dot after the \A.
      A slight niggle is that the closing quotes are included while the
      opening ones aren't. John has already posted the correction.

      By the way, as the "W" makes the search start at the beginning of the
      file anyway and the dot doesn't look for anything specific, the \A is
      superfluous here.

      This leaves me with

      ^!Find "(?s).+\K(https?://|www\.)[^\x20"\r\n<>]+" IORSW

      and it doesn't matter where in the files the cursor sits to begin with.


    • Show all 25 messages in this topic