util_email_valid_p (public)

 util_email_valid_p query_email

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Returns 1 if an email address has more or less the correct form. The initial regexp was taken from Jeff Friedls book "Mastering Regular Expressions". It was later updated with the version proposed by mozilla for the email input type validation. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#validation

Parameters:
query_email (required)
Authors:
Philip Greenspun <philg@mit.edu>
Jeff Friedl <jfriedl@oreilly.com>
Lars Pind <lars@arsdigita.com>
Héctor Romojaro
Günter Ernst

Partial Call Graph (max 5 caller/called nodes):
%3 test_host_admin_and_outgoing_sender host_admin_and_outgoing_sender (test acs-tcl) util_email_valid_p util_email_valid_p test_host_admin_and_outgoing_sender->util_email_valid_p test_util_email_valid_p util_email_valid_p (test acs-tcl) test_util_email_valid_p->util_email_valid_p acs_mail_lite::check_bounces acs_mail_lite::check_bounces (private) acs_mail_lite::check_bounces->util_email_valid_p acs_mail_lite::utils::valid_email_p acs_mail_lite::utils::valid_email_p (private, deprecated) acs_mail_lite::utils::valid_email_p->util_email_valid_p ad_page_contract_filter_proc_email ad_page_contract_filter_proc_email (public) ad_page_contract_filter_proc_email->util_email_valid_p auth::validate_account_info auth::validate_account_info (private) auth::validate_account_info->util_email_valid_p packages/acs-admin/www/users/user-batch-add-2.tcl packages/acs-admin/ www/users/user-batch-add-2.tcl packages/acs-admin/www/users/user-batch-add-2.tcl->util_email_valid_p

Testcases:
host_admin_and_outgoing_sender, util_email_valid_p
Source code:
    # This regexp was very kindly contributed by Jeff Friedl, author of
    # _Mastering Regular Expressions_ (O'Reilly 1997).
    # return [regexp "^\[^@<>\"\t ]+@\[^@<>\".\t ]+(\\.\[^@<>\".\n ]+)+$" $query_email]

    # Improved regexp from the folks at mozilla:
    # https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#validation
    return [regexp {^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$} $query_email]
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: