Reply to Re: Newbie needs help with regular expression

Your name:

Reply:


Posted by lorento on 02/16/07 10:35

$patterns = "/[^a-z0-9.-_]/i";
if (preg_match ($patterns, $word))
echo "not allowed";
else
echo "allowed";

--
http://ascii.mastervb.net -- ASCII Art Generator
http://anagram.mastervb.net -- Anagram Generator
http://www.mastervb.net/phpbooks/ -- Best PHP MySQL Books

On Feb 16, 5:19 pm, raj <r...@nospam.com> wrote:
> Hi,
>
> Please can someone help regarding providing a regular expression for entering
> a set of characters with letters, numbers, periods (.), hyphens (-), or
> underscores (_) only.
>
> I've got as far as this:
>
> $pattern="^([_a-z0-9-]+)(\.[_a-z0-9-])$";
>
> Thank you in advance.
>
> Kind regards,
>
> Raj (newbie)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация