> From: Akim Demaille <[EMAIL PROTECTED]>
> Date: 16 Nov 2000 10:45:57 +0100
> We do agree `/foo[\/]bar/' is a single pattern which matches the
> string `foo/bar', right? Then, why do you use the char class here?
Because, if my admittedly fallible memory serves, some older hosts
mishandle /foo\/bar/. I don't think they're worth worrying about
at this point, though.
As I recall, the principal use of [\/] was in search regular
expressions, not in substitution regular expressions. For example, if
you know the data cannot contain backslash, then `/foo[\/]bar/s/a/b/'
is equivalent to the POSIX `/foo\/bar/s/a/b/'.
> +Alternation, @samp{\|}, is common but not portable.
> +@c FIXME: I know Solaris is guilty, but I don't remember how.
Solaris 8 sed does not support alternation. E.g. "sed '/a\|b/d'"
deletes only lines that contain the literal string "a|b". POSIX.2
does not require support for \|, so it should be avoided in portable
scripts.