<?phpecho preg_replace('/(?:(?=(bar)))?/', '[[$1]]', "foobar"); ?>
Standard input is empty
[[]]f[[]]o[[]]o[[bar]]b[[]]a[[]]r[[]]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!