Re: [PATCH] rebase--interactive: do not use one-or-more (\+) in sed.
- From
Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
- Date
- Sep 2, 2007, 13:39 UTC
- Message-ID
- <46DABD15.4030208@fs.ei.tum.de>
- In-Reply-To
- <7vfy1xr1lz.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 8 quoted lines
>> Just for the record: I believe that \{1,\} might be portable.
>
> Yeah, I obviously looked at the page I quoted that describes
> what's in and what's not in BRE definition ;-)
>
> But in practice, I do not recall ever seeing an older sed that
> did not understand one-or-more \+ *and* understood \{1,\}. Do
> you?Yes, BSD sed (at least DragonFly's, so probably as well FreeBSD-4 (dunno about later)):
chlamydia % echo 5ab123x | sed -e 's/[a-z]\+/AAA/'
5ab123x chlamydia % echo 5ab123x | sed -e 's/[a-z]\{1,\}/AAA/'
5AAA123x chlamydia % echo 5ab123x | sed -E -e 's/[a-z]+/AAA/'
5AAA123x
cheers simon