GilliGan
[ class tree: GilliGan ] [ index: GilliGan ] [ all elements ]

Source for file RegExpConstants.inc.php

Documentation is available at RegExpConstants.inc.php

  1. <?
  2. /**
  3.  * @package GilliGan
  4.  */
  5. /**
  6.  *
  7.  * Thanks to Jeffrey E. F. Friedl for his great work:
  8.  * "Mastering Regular Expressions"
  9.  */
  10.  
  11.  
  12. /**
  13.  * Identify topleveldomains with a regular expression
  14.  */
  15.          "TOPLEVELDOMAIN""(?i:(?i)"
  16.                               ."com"
  17.                              ."|edu"
  18.                              ."|biz"
  19.                              ."|in(?:t|fo)"
  20.                              ."|mil"
  21.                              ."|net"
  22.                              ."|org"
  23.                              ."|[a-z][a-z]"
  24.                           .")"
  25.       );
  26.  
  27. /**
  28.  * Identify integer.
  29.  */
  30. define"INTEGER""(?:-?[1-9]\d*|0)" );
  31.  
  32. /**
  33.  * Identify strings that are in single quotation in a text.
  34.  */
  35. define"SINGLE_QUOTATION_STRING""(?:'.*?[^\\\\](?:\\\\\\\\)*')" );
  36.  
  37. /**
  38.  * Identify strings that are in double quotation in a text.
  39.  */
  40. define"DOUBLE_QUOTATION_STRING""(?:\".*?[^\\\\](?:\\\\\\\\)*\")" );
  41.  
  42. /**
  43.  * Identify positive integer.
  44.  */
  45. define"UNSIGNEDINTEGER""(?:[1-9]\d*|0)" );
  46.  
  47. /**
  48.  * Identify files of webgraphics.
  49.  */
  50. define"WEBGRAPHICS""[^/ &?=]+\.(?:(?i)gif|png|jpg|jpeg)" );
  51.  
  52. /**
  53.  * Identify hexadecimal colors.
  54.  */
  55. define"HEXCOLOR""#[0-9a-fA-F]{6,6}" );
  56.  
  57. /**
  58.  * Identify a time in ISO-format
  59.  */
  60. define"ISOTIME""([01]\d|2[0-3])(?::([0-5]\d)){1,2}" );
  61.  
  62. /**
  63.  * Identify
  64.  */
  65.         "EMAIL""[-a-zA-Z0-9_.]+@"
  66.                 ."(([-a-zA-Z0-9]+\\.)+"  // domain
  67.                 .TOPLEVELDOMAIN
  68.                 ."|\[?([0-9]{1,3}\.){3,3}" // ip
  69.                 ."[0-9]{1,3}\]?)"
  70.       );
  71.  
  72. /**
  73.  * Identify websafe colors.
  74.  */
  75.         "WEBSAFECOLOR""#("
  76.                          ."[0369cCfF]{3,3}"
  77.                         ."|("
  78.                           ."00"
  79.                          ."|33"
  80.                          ."|66"
  81.                          ."|99"
  82.                          ."|[cC][cC]"
  83.                          ."|[fF][fF]"
  84.                          ."){3,3}"
  85.                         .")"
  86.       );
  87.  
  88. /**
  89.  * Identify webcolor names
  90.  */
  91.         "WEBCOLORNAMES""(?:(?i)"
  92.                          ."Black"
  93.                         ."|SlateGray"
  94.                         ."|DarkGray"
  95.                         ."|DimGray"
  96.                         ."|Silver"
  97.                         ."|Beige"
  98.                         ."|WhiteSmoke"
  99.                         ."|GhostWhite"
  100.                         ."|SeaShell"
  101.                         ."|Snow"
  102.                         ."|Ivory"
  103.                         ."|White"
  104.                         ."|SandyBrown"
  105.                         ."|BurlyWood"
  106.                         ."|Peru"
  107.                         ."|Sienna"
  108.                         ."|SaddleBrown"
  109.                         ."|Brown"
  110.                         ."|Maroon"
  111.                         ."|DarkRed"
  112.                         ."|Red"
  113.                         ."|FireBrick"
  114.                         ."|Tomato"
  115.                         ."|Coral"
  116.                         ."|OrangeRed"
  117.                         ."|Darkorange"
  118.                         ."|Orange"
  119.                         ."|Yellow"
  120.                         ."|SpringGreen"
  121.                         ."|MediumSpringGreen"
  122.                         ."|YellowGreen"
  123.                         ."|LawnGreen"
  124.                         ."|Lime"
  125.                         ."|LimeGreen"
  126.                         ."|Green"
  127.                         ."|ForestGreen"
  128.                         ."|MediumSeaGreen"
  129.                         ."|SeaGreen"
  130.                         ."|OliveDrab"
  131.                         ."|Olive"
  132.                         ."|Navy"
  133.                         ."|DarkCyan"
  134.                         ."|Blue"
  135.                         ."|MediumBlue"
  136.                         ."|BlueViolet"
  137.                         ."|DarkViolet"
  138.                         ."|DarkOrchid"
  139.                         ."|Indigo"
  140.                         ."|DarkMagenta"
  141.                         ."|Purple"
  142.                         ."|VioletRed"
  143.                         ."|PaleVioletRed"
  144.                         ."|Plum"
  145.                         ."|Violet"
  146.                         .")"
  147.       );
  148. ?>

Documentation generated on Thu, 05 Jun 2008 19:14:51 +0200 by phpDocumentor 1.4.1