<?
/*
Copyright (C) 2004 Tony Bierman
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
phpgiggle-regexp.inc.php contains globally used regular expressions
see README.html for complete documentation
*/
/*
Regular expressions
Tweakable I suppsose, but at your own risk!
*/
$valid_key_regexp = "[^\w\.\_\-\:\s]"; // valid keyword
$l_regexp = "(?:\b|\s|\"|\'|\,|\.|\(|(?<!\w))"; // left of found keyword keyword in HTML
$r_regexp = "(?:\)|\b|\s|\"|\'|\,|\.(?!\w)|(?:\&\#8217\;s)|\'s|\-|s|ed|es|\!|\?)"; // right of found keyword in HTML
//$no_tags_regexp = "<(\"[^\"]*\"|\'[^\']*\'|[^\'\">]*)>"; // matches only text from HTML
$no_tags_regexp = "<(?:[^>]|\n)*>";
//$avoid_tags_regexp = "[a|h|(?:code)|(?:pre)]";
$avoid_tags_regexp = "[a|h|(?:code)]";
$valid_html_color = "^#?([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$"; // matches HTML octal color identifier
$valid_url_regexp = "^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.".
"(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}".
"[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|".
"[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&%\$#\=~_\-]+))*$"; // validates a URL
?>