You are here: !preg_match Regex not compiling « PHP Programming Language « IT news, forums, messages
!preg_match Regex not compiling

Posted by awebguynow on 11/17/51 11:34

I ran across this code, and it kind of made me nervous: (as an email
validator)

if ( !preg_match("/.*\@.*\..*/", $_POST['email']) | preg_match("/(\)/",
$_POST['email']) )

1) from bitwise experience with "C", I was not at all comforable with
!preg_match()
The manual is not clear about using ! with a non-boolean value.
When using !($var) is ($var) converted to a boolean value, before
doing the NOT oper ?

2) I believe the 2nd use of preg_match was the one that caused a
REGEX compilation error.
Warning: preg_match() [function.preg-match]: Compilation failed:
missing ) at offset 3 in ..

can anyone help ?

 

Navigation:

[Reply to this 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

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