Trying to do a preg_match to check for 3 possible patterns for a phone number...not really familiar with regex but below is what I have as my regex...it doesn't work.
match at the beginning of the string (^) and match
three digits optionally (?) followed by - or .
followed by three digits and optionally (?) followed by - or .
followed by four digits
end of the string ($)[/text]
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
I tried your suggestion and it was definitely an improvement! The only thing was that way you did it, it allowed for xxx-xxx.xxxx or xxx.xxx-xxxx and I wanted to only allow the same type of separator for both. So either 2 hyphens, 2 dots, or no separators. Below is the solution I came up with based on your suggested changes and what I had originally...I checked it a few times and seems to be working now.
The \1 is a back reference to the first capture group. So whatever was captured in the ( ) must appear where the \1 is placed.
[/text]
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.