public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: cygwin@cygwin.com
Subject: Re: manpage searches "^\s+keyword\s" vs. ???
Date: Wed, 30 Jan 2019 19:09:00 -0000	[thread overview]
Message-ID: <c8f36794-db4a-8148-0547-eaad351c7795@redhat.com> (raw)
In-Reply-To: <1210066491.20190130214043@yandex.ru>


[-- Attachment #1.1: Type: text/plain, Size: 1254 bytes --]

On 1/30/19 12:40 PM, Andrey Repin wrote:

> 
> I've been puzzled by this since… forever, it seems.
> This is something in less, but all the `man less` says is "regular expression
> library provided by your system".

\s is a non-standard regex extension - glibc provides it, Cygwin has not
(at least, historically).  POSIX provides [[:space:]] as a portable
alternative (although not all libc have implemented all of POSIX yet),
but is annoyingly long to type.

Similarly, BSD regex (which is where Cygwin derives its regex from)
supports the non-standard regex extension [[:<:]] as a word boundary,
while glibc has the same feature but spelled \<.  I also seem to recall
a patch in the past to teach Cygwin to respect \< by expanding it to
[[:<:]] before calling into the BSD-derived code (although I couldn't
actually find one in a quick search); a similar patch to expand \s into
[[:space:]] would be a reasonable idea.

> I guess this is down to compilation options at this point.

Not so much compilation options of man and less, but rather the code
used in Cygwin itself for handling regex.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-01-30 19:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28  1:47 L A Walsh
2019-01-30 18:50 ` Andrey Repin
2019-01-30 19:09   ` Eric Blake [this message]
2019-01-30 19:34     ` Corinna Vinschen
2019-01-30 19:35     ` Eric Blake
2019-01-30 21:03     ` Wayne Davison
2019-01-31  0:55   ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8f36794-db4a-8148-0547-eaad351c7795@redhat.com \
    --to=eblake@redhat.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).