Re: t9401 fails with OS X sed
- From
Jeff King <peff@peff.net>
- Date
- Oct 25, 2012, 08:41 UTC
- Message-ID
- <20121025084132.GB8390@sigill.intra.peff.net>
- In-Reply-To
- <F721B376-F4E6-4274-9A6E-BD1CFCBDA39F@adacore.com>
On Thu, Oct 25, 2012 at 01:04:11AM -0400, Geert Bosch wrote:
Show 10 quoted lines
> On Oct 24, 2012, at 23:54, Brian Gernhardt <brian@gernhardtsoftware.com> wrote: > > > It works if I change \s to [[:space:]], but I don't know how portable that is. > > As \s is shorthand for the POSIX character class [:space:], I'd say the latter > should be more portable: anything accepting the shorthand should also accept > the full character class. If not, you probably only care about horizontal tab > and space, for which you could just use a simple regular expression. Just a > literal space and tab character between square brackets is probably going to be > most portable, though not most readable.
I agree that the POSIX character class would be more portable than "\s", but we do not have any existing uses of them, and I would worry a little about older systems like Solaris. If we can simply use a literal space and tab, that seems like the safest.
Brian, can you work up a patch?
-Peff