3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = 'this is some sample'; $base = 'this is some sample [shortcode/ attr="somth"]dfdfdfdf[shortcode]text[/shortcode][shortcodeniedzialajacy]'; $pattern = "/\[(shortcode)([ ][a-zA-Z0-9\"'=\\s]*\\]|\\])/"; $matches = array(); preg_match($pattern, $string, $matches); print_r($matches);
based on ZMH3h
Output for 5.3.21 - 7.3.0rc4
Array ( )