preg match all for shortcode

I need to store this in my blog here

preg_match_all("/\/", string_page_content, $matches);

Piece of code to separate or to match shortcode ''

Which then i need to replace the string found

echo str_replace( $matches[0][0] , gallery($matches[0][0]) ,string_page_content );

for instance if i have function


function gallery($var){
echo 'THIS IS THE REPLACEMENT';
}

Is there ogoh-ogoh parade this year?

Argument continues to be voiced that classical celebrations before Nyepi just might be taken advantage of for political purposes this year.

Ogoh Ogoh Denpasar

 

a number of people making ogoh-ogoh  (hugh papier mache effigies)  in form of political figures who in corruption or sexual scandals.