Validate an email address in ColdFusion using regular expressions (regexp)
Related Categories: ColdFusion Regular Expressions
To validate an email address in ColdFusion, we use the regular expression shown below.
You could easily add this to a CFC if you wanted to return a true or false depending whether the email address validates or not.
<cfset myEmail = "test@test.com">
<CFIF REFindNocase("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name))$", trim(myEmail))>
Valid email address
<cfelse>
Oops, email address does not validate
</cfif>
ColdFusion - CFFORM (1) [RSS]
ColdFusion Regular Expressions (5) [RSS]
ColdFusion tips (2) [RSS]
database (1) [RSS]
Graphics software (1) [RSS]
JRun errors (1) [RSS]
Leisure time (3) [RSS]
Misc (2) [RSS]
Newly released BeetrootStreet websites (12) [RSS]
Search engine preparation (4) [RSS]
SQL Server hints and tips (1) [RSS]
Web application development (2) [RSS]
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Adobe Dreamweaver CS3 crashes when selecting text in code view
Greg said: Thanks... just had the same problem and this fixed it in a jiffy.
[More]
Adobe Dreamweaver CS3 crashes when selecting text in code view
Johnny said: Let me join the crowd and say THANKS!!!!
[More]
Adobe Dreamweaver CS3 crashes when selecting text in code view
Michael Markowski said: Thanks a million for this. I was going insane trying to make a few simple ColdFusion code edits in ...
[More]
Adobe Dreamweaver CS3 crashes when selecting text in code view
CAZ said: With my DW8, I had *also* to delete the Configuration dir.
If you need to do that too, I advise you...
[More]
Adobe Dreamweaver CS3 crashes when selecting text in code view
Jake said: Great. Thanks to google and thanks to you. With out both of them I'd still be trying to open Dreamwe...
[More]

There are no comments for this entry.
[Add Comment] [Subscribe to Comments]