var whatever = 'Some [b]random[/b] text in a [b]sentence.[/b]';whatever = whatever.replace(/\[(\/?)b\]/g,'<$1b>'); print(whatever);
Standard input is empty
Some <b>random</b> text in a <b>sentence.</b>
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!