manpage searches "^\s+keyword\s" vs. ???

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Jan 30 19:34:00 GMT 2019


On Jan 30 13:09, Eric Blake wrote:
> 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.

FreeBSD code since we can't use glibc code for licensing reasons.

As usual: Patches welcome!  (Even a complet replacement wouldn't hurt
as long as licensing is no issue)


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20190130/ea88e5c1/attachment.sig>


More information about the Cygwin mailing list