no next line in results?
I’ve got a playlist with lines such as:
#EXTINF:-1 tvg-id="34kanal.ua" tvg-name="34 канал" tvg-country="UA" tvg-language="Ukrainian" tvg-logo="" group-title="",34 канал (576p) http://streamvideol.luxnet.ua/34ua/34ua.stream/playlist.m3u8 #EXTINF:-1 tvg-id="34100TV.gr" tvg-name="34100 TV" tvg-country="GR" tvg-language="" tvg-logo="https://i.imgur.com/Fo1I0dt.jpg" group-title="",34100 TV (720p) https://s1.cystream.net/live/34100/playlist.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="" tvg-language="" tvg-logo="" group-title="",360 https://turkmedya-live.ercdn.net/tv360/tv360_720p.m3u8
and I want to select with this regexp:
the problem is that when I double click a result, I get two lines (which is desired),
but I see only one on the results and it isn’t convenient because I want to copy all these lines
First, your regex implies that you have the
. matches newlinebox unticked. That’s just an aside for anyone else testing this.
Second, you can’t use the Search results window for copying multline match data like you desire. As you’ve found, it only displays the first line of a multiline match.
What you can do is use the Mark feature (Ctrl+m to bring it up), with the same regular expression, followed by pressing the Copy Marked Text command button, shown here:
Hello, @patrickdrd and All,
As you know, when clicking, either, on the
Find All in Current Documentor
Find All in All Opened Documentsor
Find Allbuttons, the search process begins from the very beginning of file(s)
So, the tip is to do an alternative search, which looks, after a complete line containing the string
tvg-country="GR", for the next line, which immediately followed the previous search. This can be achieved with the
\Gassertion which match a zero-length location right after any previous search !
But this possibility must not allow to match the very first line, when, of course, no previous search has been attempted, yet ! This can be expressed with a negative look-ahead
(?!\A)placed before the
\Gassertion, expression found out by @terry-R, some time ago !
In addition, we must not search for a complete second line because the
\Gassertion must not be immediately true in order to search, again, for a new string
tvg-country="GR", first ! Thus, the correct regex to use is :
(?-s)#EXTINF ••• \G.*,
(?-s)#EXTINF ••• \G.*\Ror
(?-s)#EXTINF ••• \G.+\RCANNOT work !
Note that, if an empty line immediately follows a searched line
#EXTINF •••••, this empty line is not outputed in the
Search resultsdialog ( minor drawback )
So a generic regex, related to this example, could be :
which displays, in the
Search Resultsdialog, any line containing
Expressionand its next non-empty line
It’s worth to point out that, if we use the
Markfeature, your initial regex
(?-s)^#EXTINF.*tvg-country="GR".*\R.*\Ris sufficient ;-))
Just seen the @alan-kilborn solution : Nice too !
In light of Guy’s solution (nice one, too!), when I said earlier:
you can’t use the Search results window for copying multline match data … it only displays the first line of a multiline match.
This is still a true statement.
What Guy’s solution to the problem does is create a second match.
As this match is (somewhat) independent of the first, it DOES appear in the Search results window and thus can be copied from there, as originally desired.