diff --git a/webtools/bugzilla/defparams.pl b/webtools/bugzilla/defparams.pl
index c0e1a9fa98b3..45e67d5322ac 100644
--- a/webtools/bugzilla/defparams.pl
+++ b/webtools/bugzilla/defparams.pl
@@ -449,10 +449,17 @@ sub check_webdotbase {
return "";
}
+sub checkregexp {
+ my ($value) = (@_);
+ eval { qr/$value/ };
+ return $@;
+}
+
DefParam("emailregexp",
'This defines the regexp to use for legal email addresses. The default tries to match fully qualified email addresses. Another popular value to put here is ^[^@]+$, which means "local usernames, no @ allowed."',
"t",
- q:^[^@]+@[^@]+\\.[^@]+$:);
+ q:^[^@]+@[^@]+\\.[^@]+$:,
+ \&checkregexp);
DefParam("emailregexpdesc",
"This describes in english words what kinds of legal addresses are allowed by the emailregexp param.",