e-mail validation - are you serious??

Author Message

Thomas Brandl

Friday 26 September 2003 5:42:29 am

ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $address) );

this allows quite everything, @ and . given!

I think that comes much closer (and simpler!), but likely to be improved. Comments welcome (preg):
^[a-z0-9][-._a-z0-9]*@(?:[a-z0-9][-_a-z0-9]*\.)+[a-z]{2,4}$

Paul Borgermans

Friday 26 September 2003 7:44:15 am

Yeah

But email urls like mailto:thomas@somewhere.com?subject=You%20love%20preg
should also be possible

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 03:27:21
Script start
Timing: Jan 31 2025 03:27:21
Module start 'layout'
Timing: Jan 31 2025 03:27:21
Module start 'content'
Timing: Jan 31 2025 03:27:23
Module end 'content'
Timing: Jan 31 2025 03:27:23
Script end

Main resources:

Total runtime1.2313 sec
Peak memory usage8,192.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 588.1406151.2109
Module start 'layout' 0.00770.0048 739.3516220.7031
Module start 'content' 0.01251.2180 960.05474,430.8750
Module end 'content' 1.23050.0008 5,390.92977.8438
Script end 1.2313  5,398.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.3096160.0002
Check MTime0.00140.1112160.0001
Mysql Total
Database connection0.00130.102310.0013
Mysqli_queries1.149293.3320540.0213
Looping result0.00060.0484520.0000
Template Total1.159594.220.5798
Template load0.00220.179820.0011
Template processing1.157393.983920.5786
Template load and register function0.00190.151310.0019
states
state_id_array0.00180.148010.0018
state_identifier_array0.00220.180020.0011
Override
Cache load0.00190.1513130.0001
Sytem overhead
Fetch class attribute can translate value0.00190.157920.0010
Fetch class attribute name0.00210.168430.0007
XML
Image XML parsing0.00200.163920.0010
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00210.1681170.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs