This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]