24127RE: Re: [Clip] REGEX Search Backward
- Nov 2, 2013
Yes. Your regex together with the W option fixes the issues associated with start location. There remains one hassle. For example, say the following URL is the last URL in the text.
http://www.logicalchess.com/The regex finds and highlights only www.logicalchess.com/ instead of the full http://www.logicalchess.com/.My objective is to find and fully highlight the last URL in a list of URLs where the URLs can start with either http or www.
---In firstname.lastname@example.org, <email@example.com> wrote:nullclip@... wrote:
> 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 >>