Filling Patterns with ereg
<?php
$s = 'm@t.ca';
if (ereg ('([[:alpha:]]+)@([[:alpha:]]+)\.([[:alpha:]]{2,4})', $s, $matches))
{
echo "Regular expression successful. Dumping matches\n";
var_dump ($matches);
}
else
{
echo "Regular expression unsuccessful.\n";
}
?>
Related examples in the same category