3 ms·
Wow that's ugly. The original regex is a valid POSIX BRE; it also works in GNU sed and FreeBSD sed with default options. But maybe your translation will be usef
by firethief 11y ago
Wow that's ugly. The original regex is a valid POSIX BRE; it also works in GNU sed and FreeBSD sed with default options. But maybe your translation will be useful to others who only grok PCRE.
- simcop2387 11y agoThe original version isn't actually valid POSIX BRE. It's a sed specific meta-character that is specific to sed and won't work anywhere else [1]. It's not part of POSIX BRE (which doesn't cover substations anyway). The zero width positive look behind is common to many more languages than just sed for doing that substitution. There is one version that will work in all of them, s/rump/rump kernel/, but it repeats the first word [1] http://docstore.mik.ua/orelly/unix/sedawk/appa_02.htm http://docstore.mik.ua/orelly/unix/sedawk/appa_02.htm