On Mon, Dec 12, 2005 at 12:36:06AM +0100, Bernd Warken wrote:
> 
> [EMAIL PROTECTED] schrieb am 12.12.05 00:12:28:
> > 
> > On the whole, for maximum portability, I'd be inclined to adopt the syntax 
> > suggested by Zvezdan, i.e.
> > 
> >     sed -e 's/^.* \([^ ]\{1,\}\)$/\1/' -e '1q'
> > 
> The \{...\} construct might be critical as well.  So the best way might be to
> replace c+ or c\{1,\} by cc*
> 
>   sed -e 's/^.* \([^ ][^ ]*\)$/\1/' -e '1q'
> 

POSIX sed has \{...\}.
I'm not aware of any sed implementation with which it doesn't work.
However, I'm currently able to test it only on Solaris, HP-UX, Linux and
OpenBSD.
Do you know of any example where it doesn't work?

Otherwise we might go even deeper and say that \(...\) is questionable,
etc.  But I think there's no need for it.
The expressions \{...\} and \(...\) is a part of BREs (Basic Regular
Expressions) for a long time.

Just my two cents.

Best regards,

        Zvezdan Petkovic


_______________________________________________
Groff mailing list
Groff@gnu.org
http://lists.gnu.org/mailman/listinfo/groff

Reply via email to