By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,407 Members | 1,753 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,407 IT Pros & Developers. It's quick & easy.

!preg_match Regex not compiling

P: n/a
I ran across this code, and it kind of made me nervous: (as an email

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

1) from bitwise experience with "C", I was not at all comforable with
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 ?

Dec 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.