<?php
$regex = '~(?:{[^}]+}|"Tarzan\d+")(*SKIP)(*F)|Tarzan\d+~';
$subject = 'Jane" "Tarzan12" Tarzan11@Tarzan22 {4 Tarzan34}';
$count = preg_match_all($regex, $subject, $matches);
// $matches[0] contains the matches, if any

///////// The six main tasks we're likely to have ////////

// Task 1: Is there a match?
echo "*** Is there a Match? ***<br />\n";
if($count) echo "Yes<br />\n";
else echo "No<br />\n";

// Task 2: How many matches are there?
echo "\n<br />*** Number of Matches ***<br />\n";
if($count) echo count($matches[0])."<br />\n";
else echo "0<br />\n";

// Task 3: What is the first match?
echo "\n<br />*** First Match ***<br />\n";
if($count) echo $matches[0][0]."<br />\n";

// Task 4: What are all the matches?
echo "\n<br />*** Matches ***<br />\n";
if($count) {
	foreach ($matches[0] as $match) echo $match."<br />\n";
}

// Task 5: Replace the matches
$replaced = preg_replace($regex,"Superman",$subject);
echo "\n<br />*** Replacements ***<br />\n";
echo $replaced."<br />\n";

// Task 6: Split
$splits = preg_split($regex,$subject);
echo "\n<br />*** Splits ***<br />\n";
echo "<pre>"; print_r($splits); echo "</pre>"; 
?>