Also if you want to learn the regex syntax the good old way then you can find the official documentation of the syntax at http://au2.php.net/manual/en/regexp.reference.php
You will find that the easiest way to learn is by starting with simple regex commands such as modifying existing ones then working you way up the scale untill you can memorize what everything does.
Also as for the regex validation you have requestion, the following may do the job:
<?
//name
if (pregmatch('/((*[ ]*|*\-\-*)?[ ](*[ ]*|*\-\-*)|(*[ ]*|*\-\-*)[ ](*[ ]*|*\-\-*)?)/i',$data)) {
//error found as name contains double dash or more than one space
}
//phone
if (pregmatch('/[^0-9]/i',$data)) {
//error found as it contains non-number characters
}
?>
---------
I thought I would share a joke from phpfreaks forums:
If preg was a women I would the pattern and she would replace me with $1.
Thats preg_replace right.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259