#!/bin/bashecho '//apple' | sed 's/^\(\/\{0,2\}\)apple\(\/\)\?/\1banana\2/'echo '//apple' | sed -E 's~^(/{0,2})apple(/)?~\1banana\2~'
Standard input is empty
//banana //banana
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!