On 9/20/2015 11:21 AM, Ian Zimmerman wrote:
> Is there a filter type program that copies its stdin to its stdout, but
> with all regexp metacharacters escaped? I do mean regexp, not glob.
>
> I can certainly write a sed script to the same effect. It just seems a
> generic enough task that someone must have already done it. :-P
>
No because there's BREs and EREs and PCREs and POSIX/non-POSIX and escaping RE
metachars doesn't meant the tool will work (e.g. sed '/re/' needs the /s escaped
inside re as well as the re metachars), etc.
If you want something that';ll work for sed, see