Perl Compatible Regexes
<?php
    
if (preg_match('/^\d{5}(-\d{4})?$/',
                   
$_POST['zip'])) {  }
?>
<?php
    $text 
"Hello, /Alice/. How are you?";
    print 
preg_replace('{/([^/]+)/}','<b>\\1</b>',
                       
$text);
?>
Output
Hello, Alice. How are you?