<?php $str = '[date|Y-m-d]';preg_match_all('/[^][|]+/', $str, $matches);print_r($matches[0]);
Standard input is empty
Array ( [0] => date [1] => Y-m-d )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!