From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74059 invoked by alias); 30 Jan 2019 19:35:58 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 74051 invoked by uid 89); 30 Jan 2019 19:35:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Principal X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Jan 2019 19:35:57 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5C1D811DA for ; Wed, 30 Jan 2019 19:35:55 +0000 (UTC) Received: from [10.3.117.44] (ovpn-117-44.phx2.redhat.com [10.3.117.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7B7A608C1 for ; Wed, 30 Jan 2019 19:35:55 +0000 (UTC) Subject: Re: manpage searches "^\s+keyword\s" vs. ??? To: cygwin@cygwin.com References: <5C4E5F0F.2090403@tlinx.org> <1210066491.20190130214043@yandex.ru> From: Eric Blake Openpgp: preference=signencrypt Message-ID: <5ff5040c-ae51-8b0b-4157-e4a0b8f778c8@redhat.com> Date: Wed, 30 Jan 2019 19:35:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CIBnOk5MIqGuAQT8W9ApApBXcXf2msVaE" X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00300.txt.bz2 --CIBnOk5MIqGuAQT8W9ApApBXcXf2msVaE Content-Type: multipart/mixed; boundary="x1G6d553n0YxuHsrCHXZrSRoeVAXPdcXU"; protected-headers="v1" From: Eric Blake To: cygwin@cygwin.com Message-ID: <5ff5040c-ae51-8b0b-4157-e4a0b8f778c8@redhat.com> Subject: Re: manpage searches "^\s+keyword\s" vs. ??? References: <5C4E5F0F.2090403@tlinx.org> <1210066491.20190130214043@yandex.ru> In-Reply-To: --x1G6d553n0YxuHsrCHXZrSRoeVAXPdcXU Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Content-length: 1451 On 1/30/19 1:09 PM, Eric Blake wrote: > \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. >=20 > 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. Found it: https://sourceware.org/git/?p=3Dnewlib-cygwin.git;a=3Dblob;f=3Dwinsup/cygwi= n/regex/regcomp.c;h=3D180f599c#l425 and indeed, Cygwin fakes \< and \> but NOT \s or \b (for those, you'd have to submit a patch to that spot in regcomp.c). >=20 >> I guess this is down to compilation options at this point. >=20 > Not so much compilation options of man and less, but rather the code > used in Cygwin itself for handling regex. Also a good read: https://stackoverflow.com/questions/9792702/does-bash-support-word-boundary= -regular-expressions --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org --x1G6d553n0YxuHsrCHXZrSRoeVAXPdcXU-- --CIBnOk5MIqGuAQT8W9ApApBXcXf2msVaE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 488 -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlxR/JoACgkQp6FrSiUn Q2q5Bgf+KZfUnlFNfdYGVK8kLt1/+bK+qJUe5C5pclf5/LLdPDvaZ0zWy3vLi9ej pkEH/XBu34D2roP8eo+suD7mZ1bEOT2VAYgTa5+8UOExlhO03iKzHWUnU/mifuO7 FvEjxwx/SUqOr+RxSyyc3nT21mNIdJ8aYPlQC21UNi03zbzCnqQPVjxlu/b2xxqS knZuArq4NmrsMGPAsMwFp96TSsxtP9TsbQjzH65L+qbQvQg9QEPpupF5JdEyfTqC ntp+Xqv+dBk5ZdVZ+U7UDuC46CD5Uk84MHJoNnLVRb0PCq5Wau6wpiW9jDCWZMIf Ix9u55qbvWa11SJdhkkzjaWQ4TTNTQ== =fpvA -----END PGP SIGNATURE----- --CIBnOk5MIqGuAQT8W9ApApBXcXf2msVaE--