Replace multiple strings, O(1) wrt number of replacements
unix.stackexchange.com
unix.stackexchange.com
I googled a bit and found this amazing gem: it uses lex to create a custom C program that does just what you want. Posix compliant. All wrapped up in bash function.