×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Сергей Шевченко
Added: Jan 23, 2017 6:03 AM
Modified: Jan 11, 2018 7:28 PM
Views: 22
url, color, email, phone, date
  1. $urlPattern    = '#(\A|[^=\]\'\"a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^()<>\s]+)#i';
  2. $colorPattern  = '#^[0-9a-fA-F]{3,6}$#i';
  3. $emailPattern  = '#\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6}#i';
  4. $phonePattern  = '#^((8|\+7|7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$#i';
  5. $datePattern   = '#^\d{4}-\d{1,2}-\d{1,2}$#';