Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Jul 2014 17:20:28 -0500
From:      Pedro Giffuni <pfg@freebsd.org>
To:        Bryan Drewery <bdrewery@FreeBSD.org>
Cc:        freebsd-standards@FreeBSD.org
Subject:   Re: regex(3): support for \< and \> word delimiters
Message-ID:  <53B485AC.3060706@freebsd.org>
In-Reply-To: <53B477E6.10103@FreeBSD.org>
References:  <53556919.4010305@freebsd.org> <53ADD32C.5040503@FreeBSD.org> <20545470-A847-4835-A42B-382E5CC363ED@freebsd.org> <53B477E6.10103@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 07/02/14 16:21, Bryan Drewery wrote:
> On 6/27/2014 4:15 PM, Pedro Giffuni wrote:
>> Hi;
>>
>> Il giorno 27/giu/2014, alle ore 15:25, Bryan Drewery <bdrewery@FreeBSD.org> ha scritto:
>>
>>> On 4/21/2014 1:53 PM, Pedro Giffuni wrote:
>>>> Hello;
>>>>
>>>> Is there any related standard (or in absence strong feelings)
>>>> about having \< and \> delimiters in regex expressions?
>>>>
>>>> I have an old PR bin/153257 which actually comes from illumos:
>>>> https://www.illumos.org/issues/516
>>>>
>>>> I don't use them but maybe it would help people moving their
>>>> scripts from Solaris.
>>>>
>>>> Regards,
>>>>
>>>> Pedro.
>>> I don't know about a standard, but I find the lack of \< \> to be a
>>> frustrating difference with other platforms. [[:<:]] [[:>:]] work but
>>> are far more characters to type.
>>>
>> Thank you for the feedback! I had closed the issue because I thought there was no interest.
>>
>> Another thing that needed consideration was that I thought there was some work going on to replace libregex with libtre, which doesn’t support *any* such delimiter so committing the change would raise the bar for the replacement. Discussing it with Gabor it seems like libtre is not in the capacity of replacing our current libregex anyways so I guess Spencer’s libregex is here to stay.
>>
>> While here, there is also the sed(1) syntax issue:
>>
>> https://www.illumos.org/issues/586
>>
>> Adopting both changes would probably reduce to a minimum the use of GNU sed in the ports tree, but such changes are likely to be controversial(?) and I don’t feel like wearing asbestos underwear at this time .. at least not for sed ;).
>>
>> Pedro.
>>
> IMHO yes that is a good thing to bring over as it helps with people
> coming from other platforms and improves portability with scripts. I
> started on Linux and kept wondering why I had FILEe files all over my
> system until I realized -i '' was required on FreeBSD.
>

The original idea was, more or less, the contrary: by being stricter
about non-standard extensions you can be sure that the code
you made on FreeBSD will run unchanged on all existing
platforms.

It is difficult to strike a balance though: POSIX has been
adopting some GNU extensions, so even if we reject them
initially at some point they become necessary.

The sed enhancement is actually pretty easy, and it looks like,
in addition to illumos, NetBSD has it too. It is not high on my
todo list though ;).

Pedro.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53B485AC.3060706>