<?php
// --------------------------------------------------------------------------
//
// Esvon Classifieds v.4.0
// Copyright(C), Esvon LTD, 2001-2010, All Rights Reserved.
// E-mail: hide@address.com
//
// All forms of reproduction, including, but not limited to, internet posting,
// printing, e-mailing, faxing and recording are strictly prohibited.
// One license required per site running Esvon Classifieds.
// To obtain a license for using Esvon Classifieds, please register at
// http://www.esvon.com/pg/products/p_classifieds/
//
// --------------------------------------------------------------------------
function hwRegExpGet($_input, $_char){
if(!$_input && !$_char) return '';
$f_regexp = '';
if($_char){
$f_regexp = preg_quote($_char, '/');
$f_regexp = addcslashes($f_regexp, '-');
}
$_wrap = 1;
if(strpos('|strip_url|','|'.$_input.'|')===false){
switch($_input){
case 'alpha' :
$f_regexp = "[$f_regexp\w]+";
break;
case 'digit' :
$f_regexp = "[$f_regexp\d]+";
break;
case 'email' :
$f_regexp = defined('REGEX_EMAIL') ? REGEX_EMAIL : '[^@\s]+@(?:[-a-z0-9]+\.)+[a-z]{2,}';
break;
case 'url' :
$f_regexp = 'https?:\/\/[^\s"\']+';
break;
case 'decimal' :
$f_regexp = '[0-9]{1,20}\.?[0-9]{0,20}';
break;
default :
$f_regexp = str_replace('/','\/',$_input);
$_wrap = 0;
}
}
if($_wrap && $f_regexp) $f_regexp = '^'.$f_regexp.'$';
return $f_regexp;
}
/*
No email or URL : (!preg_match/i)
(?:ht|f)tps?\:\/\/|www\.|\.(?:com|org|net|us|ws|tv|info)|[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+
*/
?>