* Re: [gentoo-user] search patterns in less(1)
2019-07-18 22:40 [gentoo-user] search patterns in less(1) n952162
@ 2019-07-18 20:55 ` Michael Orlitzky
2019-07-19 6:40 ` n952162
0 siblings, 1 reply; 6+ messages in thread
From: Michael Orlitzky @ 2019-07-18 20:55 UTC (permalink / raw
To: gentoo-user
On 7/18/19 6:40 PM, n952162 wrote:
> in less(1), how do you search for a pattern at the beginning (or ending)
> of a word.
>
Hit front slash "/" in less, and then type a perl-compatible regular
expression. Specifically, try
https://www.pcre.org/original/doc/html/pcrepattern.html#smallassertions
>
> Also, where the change is documented.
>
man less
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gentoo-user] search patterns in less(1)
@ 2019-07-18 22:40 n952162
2019-07-18 20:55 ` Michael Orlitzky
0 siblings, 1 reply; 6+ messages in thread
From: n952162 @ 2019-07-18 22:40 UTC (permalink / raw
To: gentoo-user
in less(1), how do you search for a pattern at the beginning (or ending)
of a word.
Elsewhere, you prepend (or append) the pattern with \< (\>) but that's
not working for me with gentoo.
Also, where the change is documented.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] search patterns in less(1)
2019-07-18 20:55 ` Michael Orlitzky
@ 2019-07-19 6:40 ` n952162
2019-07-19 15:28 ` Michael Orlitzky
2019-07-19 16:29 ` [gentoo-user] " Ian Zimmerman
0 siblings, 2 replies; 6+ messages in thread
From: n952162 @ 2019-07-19 6:40 UTC (permalink / raw
To: gentoo-user
The man page says:
The pattern is a regular expression, as recognized by
the regular expression library supplied by your system
There are many regular expression libraries on my system.
Anyway, thank you for the (unexpected) tip:
man perlre
That says to use \b instead of the decades-old \<.
On 07/18/19 20:55, Michael Orlitzky wrote:
> On 7/18/19 6:40 PM, n952162 wrote:
>> in less(1), how do you search for a pattern at the beginning (or ending)
>> of a word.
>>
> Hit front slash "/" in less, and then type a perl-compatible regular
> expression. Specifically, try
>
> https://www.pcre.org/original/doc/html/pcrepattern.html#smallassertions
>
>
>> Also, where the change is documented.
>>
> man less
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] search patterns in less(1)
2019-07-19 6:40 ` n952162
@ 2019-07-19 15:28 ` Michael Orlitzky
2019-07-19 15:44 ` Michael Orlitzky
2019-07-19 16:29 ` [gentoo-user] " Ian Zimmerman
1 sibling, 1 reply; 6+ messages in thread
From: Michael Orlitzky @ 2019-07-19 15:28 UTC (permalink / raw
To: gentoo-user
On 7/19/19 2:40 AM, n952162 wrote:
> The man page says:
>
> The pattern is a regular expression, as recognized by
> the regular expression library supplied by your system
>
> There are many regular expression libraries on my system.
>
You caught me, I did
$ ldd /usr/bin/less
linux-vdso.so.1 (0x00007fffb1ea9000)
libncursesw.so.6 => /lib64/libncursesw.so.6 (0x00007fce26a12000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fce269cc000)
libc.so.6 => /lib64/libc.so.6 (0x00007fce267fc000)
/lib64/ld-linux-x86-64.so.2 (0x00007fce26ae5000)
and saw libpcre in there.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] search patterns in less(1)
2019-07-19 15:28 ` Michael Orlitzky
@ 2019-07-19 15:44 ` Michael Orlitzky
0 siblings, 0 replies; 6+ messages in thread
From: Michael Orlitzky @ 2019-07-19 15:44 UTC (permalink / raw
To: gentoo-user
On 7/19/19 11:28 AM, Michael Orlitzky wrote:
> On 7/19/19 2:40 AM, n952162 wrote:
>> The man page says:
>>
>> The pattern is a regular expression, as recognized by
>> the regular expression library supplied by your system
>>
>> There are many regular expression libraries on my system.
>>
>
Actually, the ambiguity in the man page is there for a reason. When you
configure less, you can pass --with-regex=<library> to select an
implementation. You get libpcre with USE=pcre in Gentoo. Without
USE=pcre, I think you get the GNU libc implementation (from grep et al.)
that just coincidentally supports "\b" as well.
There are a few other options for that flag that aren't available in
Gentoo, though, so the man page is being vague out of necessity.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gentoo-user] Re: search patterns in less(1)
2019-07-19 6:40 ` n952162
2019-07-19 15:28 ` Michael Orlitzky
@ 2019-07-19 16:29 ` Ian Zimmerman
1 sibling, 0 replies; 6+ messages in thread
From: Ian Zimmerman @ 2019-07-19 16:29 UTC (permalink / raw
To: gentoo-user
On 2019-07-19 06:40, n952162 wrote:
> Anyway, thank you for the (unexpected) tip:
>
> man perlre
>
> That says to use \b instead of the decades-old \<.
I did not expect it either, but I convinced myself running
ldd `which less`
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-07-19 16:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-18 22:40 [gentoo-user] search patterns in less(1) n952162
2019-07-18 20:55 ` Michael Orlitzky
2019-07-19 6:40 ` n952162
2019-07-19 15:28 ` Michael Orlitzky
2019-07-19 15:44 ` Michael Orlitzky
2019-07-19 16:29 ` [gentoo-user] " Ian Zimmerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox