You didn’t add the shortcode via the shortcode API. WordPress only recognizes shortcodes if they are added with:
add_shortcode( 'yourshortcode', 'yourshortcodefunc' );
I personally would not use preg_replace for this because it is more of a hit and miss. You should follow the official guidelines off the WordPress Codex. Recommended code structure for shortcodes is:
// [bartag foo="foo-value"]
function bartag_func( $atts ) {
extract( shortcode_atts( array(
'foo' => 'something',
'bar' => 'something else',
), $atts ) );
return "foo = {$foo}";
}
add_shortcode( 'bartag', 'bartag_func' );