×

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: May 23, 2017 4:00 PM
Views: 19
Tags: no tags
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}$#';