Closed d-nnis closed 7 years ago
Most platforms I found accept -E
, though it might not be the POSIX standard. MacOS however only accepts -E
, not -r
. Do you have a version of send that doesn't accept -E
?
(Actually POSIX doesn't mention EREs or either flag at all)
That is weird. man sed
states this for sed 4.2.2 on Linux edgar 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux
So far I found it here. The manual from the gnu-website mentions both -r
and -E
.
Hmm. And actually sed -E
works as well, though it is not documented in the man available offline on my system.
echo "something" | sed -E 's/(o)/\1T/'
soTmething
So you might just leave it on your website...
So -E
seems to be the BSD flag (also accepted by GNU sed) and -r
the GNU flag (though it is accepted by some BSD versions).
On FreeBSD, the manual reads:
-r Same as -E for compatibility with GNU sed.
So I'm going to keep -E
in the table. Thanks for looking at this!
The last line in the last table is false on the website. The ERE switch for sed to use extended regular expressions is
-r
or--regexp-extended
man sed sais