<?php$haystack = "abc[d]-ef";preg_match_all('/[][-]/', $haystack, $matches);print_r($matches);
Standard input is empty
Array ( [0] => Array ( [0] => [ [1] => ] [2] => - ) )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!