4 ms·
If I had a time machine, the first thing I'd do is s/rump/& kernel/ in all old writings. The second thing I'd do is make a case for writing creat with an e.
by anttiok 11y ago
If I had a time machine, the first thing I'd do is s/rump/& kernel/ in all old writings. The second thing I'd do is make a case for writing creat with an e.
- simcop2387 11y agodo you mean, s/(?<=rump)/ & kernel/g? That'll tack " & kernel" on after every "rump": https://regex101.com/r/rZ7kA2/1 https://regex101.com/r/rZ7kA2/1
- firethief 11y agoWow 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