Преобразование PHP-функции в JavaScript
if (preg_match('/0/', $check) || preg_match('/1/', $check) || preg_match('/2/', $check) || preg_match('/3/', $check) || preg_match('/4/', $check) || preg_match('/5/', $check) || preg_match('/6/', $check) || preg_match('/7/', $check) || preg_match('/8/', $check) || preg_match('/9/', $check))
{
exception("personal info not allowed");
redirect(base_url() . 'edit_profile');
}
else if ((preg_match("~\b@\b~",$check)) || (preg_match("~\b.net\b~",$check)) || (preg_match("~\b.com\b~",$check)) || (preg_match("~\b@\b~",$check)) || (preg_match("~\b.edu\b~",$check)) || (preg_match("~\b.gov\b~",$check)))
{
exception("personal info not allowed");
redirect(base_url() . 'edit_profile');
}