24126RE: [Clip] REGEX Search Backward
- 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.
> The work-around is to put the cursor at the start of theSorry, I can't reproduce that. So far I had only followed the thread
> document or outline topic's text before beginning the search
> for the last URL.
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
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.
- << Previous post in topic Next post in topic >>