#!/bin/bashs="say: a[aa] and a[aa]! to bbb, not ba[aa] or a[aa]b"sed -E 's~([^_[:alnum:]]|^)a\[aa]([^_[:alnum:]]|$)~\1bbb\2~g' <<< "$s"
Standard input is empty
say: bbb and bbb! to bbb, not ba[aa] or a[aa]b
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!