Re: REGEX validating email
Corrected RE is below. Toward the end, I added a \ at *\.[[:alpha:]]{2,}$ "^([[:alnum:]][-a-Sa-Z0-9_%\.]*)?[[:alnum:]]@[[:alnum:]] [-a-Sa-Z0-9%\ .]*\.[[:alpha:]]{2,}$" Actually, I think your ranges are a little off. For instance, I think you mean -a-zA-Z0-9 instead of -a-Sa-Z. I corrected the ranges to produce "^([[:alnum:]][-a-zA-Z0-9_%\.]*)?[[:alnum:]]@[[:alnum:]][-a-zA-Z0-9%\ .]*\.[[:alpha:]]{2,}$" which seems to work like a charm. The $ at the end functions exactly like the ^ at the beginning. It functions as an anchor and says "the string must end here". Otherwise, any string that _begins_ with a match for the RE is seen as a match and return TRUE. Using both ^ and $ means that the whole string must be a match for the pattern, rather than just _containing_ the pattern. Now that you mention it, it does sound familiar. Thanks for all of the help. Best Regards, Seth Petry-Johnson Argo Enterprise and Associates -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: REGEX validating email
Yep, something got munged in the copying. Thanks for catching it. Jim -Original Message- From: Seth Petry-Johnson [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Monday, June 19, 2000 8:08 PM Subject: Re: REGEX validating email Corrected RE is below. Toward the end, I added a \ at *\.[[:alpha:]]{2,}$ "^([[:alnum:]][-a-Sa-Z0-9_%\.]*)?[[:alnum:]]@[[:alnum:]] [-a-Sa-Z0-9%\ .]*\.[[:alpha:]]{2,}$" Actually, I think your ranges are a little off. For instance, I think you mean -a-zA-Z0-9 instead of -a-Sa-Z. I corrected the ranges to produce "^([[:alnum:]][-a-zA-Z0-9_%\.]*)?[[:alnum:]]@[[:alnum:]][-a-zA-Z0-9%\ .]*\.[[:alpha:]]{2,}$" which seems to work like a charm. The $ at the end functions exactly like the ^ at the beginning. It functions as an anchor and says "the string must end here". Otherwise, any string that _begins_ with a match for the RE is seen as a match and return TRUE. Using both ^ and $ means that the whole string must be a match for the pattern, rather than just _containing_ the pattern. Now that you mention it, it does sound familiar. Thanks for all of the help. Best Regards, Seth Petry-Johnson Argo Enterprise and Associates - - Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: REGEX validating email
Chris, Way back in the beginning of April you posted the following regexp to the CF-Talk as a regexp that can be used to check whether or not a string is a properly formatted email address. Here's the code I use CFSET IsEmail = REFind("^([[:alnum:]][-a-zA-Z0-9_%\.]*)?[[:alnum:]]@[[:alnum:]][-a-zA-Z0-9%\ .]*.[[:alpha:]]{2,}$", email) I liked your regexp so much more than my long, drawn out method so I cut and pasted your code into my templates and went about my business. Well, I just discovered that the above regexp has a flaw. My regexp skills aren't quite as sharp as they should be, so I haven't had the best of luck figuring out the problem on my own. The problem I have is that this regexp returns true on a string containing some alpha numeric characters, the "@", and then 4 more characters EXCLUDING a period. For example, if I pass "seth@argo" to the regexp it returns true, signifying that the string is in fact a valid email address. If there are three or less characters after the "@" then it correctly returns false. The logic of the regexp SEEMS correct to me, and I can't seem to figure out why this is happening. I've double checked my code 4 times, and I have EXACTLY what you posted to the list. Could you please check and make sure that this is indeed the regexp that you use (i.e. make sure there are no typos). If it is NOT could you be so kind as to send me the correct one? If this IS what you are using then you might want to check and see if your sites suffer from the same error. Finally, one last and final question: the only character in your regexp that I don't understand is the "$" at the very end. I can't find an explanation of this meta character anywhere in Forta's section on regular expressions. What exactly does this character do? Regards, Seth Petry-Johnson Argo Enterprise and Associates -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: REGEX validating email
Here's the RegEx string I use to validate E-mail addresses .. maybe thiw will work better for you? var emailexp = /^[a-z][a-z_0-9\.]+@[a-z_=0-9\.]+\.[a-z]{3}$/i Todd - Original Message - From: "Brian Peddle" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 31, 2000 6:10 PM Subject: REGEX validating email Im doing some server side validation and Im trying to make sure the '@' and the '.' is in there. I have played with a variety of things and cant get it to work. Here is the last one I tried. cfif refindnocase("[a-z0-9_\.]+@[a-z0-9-]",form.primary_email) gt 1 Bad Email /cfif Thanks! -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: REGEX validating email
This doesn't answer your specific question but you could try using a Custom Tag like CF_MailTest (which we use) which can be found in the Tag Gallery. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Simon Park Computer Systems Management, Inc. [EMAIL PROTECTED] 205 South Whiting Street Ph: 703-823-4300Suite 201 fax: 703-823-4301 Alexandria, VA 22304 http://www.csmi.com -Original Message- From: Brian Peddle [mailto:[EMAIL PROTECTED]] Sent: Friday, March 31, 2000 5:10 PM To: [EMAIL PROTECTED] Subject: REGEX validating email Im doing some server side validation and Im trying to make sure the '@' and the '.' is in there. I have played with a variety of things and cant get it to work. Here is the last one I tried. cfif refindnocase("[a-z0-9_\.]+@[a-z0-9-]",form.primary_email) gt 1 Bad Email /cfif -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: REGEX validating email
Go to: http://www.desertraven.com/codemodules.php and download cf_checkemail There's a very comprehensive regex in it you can analyse to your heart's content. :) Michael J. Sheldon Internet Applications Developer Phone: 480.699.1084 http://www.desertraven.com/ PGP Key Available on Request -Original Message- From: Brian Peddle [mailto:[EMAIL PROTECTED]] Sent: Friday, March 31, 2000 15:10 To: [EMAIL PROTECTED] Subject: REGEX validating email Im doing some server side validation and Im trying to make sure the '@' and the '.' is in there. I have played with a variety of things and cant get it to work. Here is the last one I tried. cfif refindnocase("[a-z0-9_\.]+@[a-z0-9-]",form.primary_email) gt 1 Bad Email /cfif Thanks! -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: REGEX validating email
Try this: REFindNoCase('[[:alnum:]_\.\-]+@([[:alnum:]_\.\-]+\.)+[[:alpha:]]{2,4}', "#form.email#") = Howard Owens Web Producer InsideVC.com mailto:[EMAIL PROTECTED] = -Original Message- From: Brian Peddle [SMTP:[EMAIL PROTECTED]] Sent: Friday, March 31, 2000 2:10 PM To: [EMAIL PROTECTED] Subject: REGEX validating email Im doing some server side validation and Im trying to make sure the '@' and the '.' is in there. I have played with a variety of things and cant get it to work. Here is the last one I tried. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: REGEX validating email
For form validation on email characters "@, ." where do you place this script on the template? Example form page would be great! Thanks KM Seth Petry-Johnson wrote: Im doing some server side validation and Im trying to make sure the '@' and the '.' is in there. I have played with a variety of things and cant get it to work. I don't know about using a RegEX for this, but I've done it with normal string operations. The following script verifies that: 1) The email string is not empty 2) A "@" exists once and only once 3) At least one "." follows the "@", and the "." does not come at the very end of the string I wrote this a long time ago, so there may be a few holes in it. !--- strEmail contains the entered email address --- !--- booEmailValid is TRUE if it is a valid address --- CFSET booEmailValid = "True" !--- test the length --- CFIF NOT Len(strEmail) CFSET booEmailValid = "False" CFELSE !--- make sure only one '@' symbol exists, and that a "." follows it --- CFSET intPosOfAt = Find("@", strEmail) CFSET intPosOfPer = Find(".", strEmail, intPosOfAt + 1) !--- make sure a "@" exists --- CFIF intPosOfAt LTE 1 CFSET booEmailValid = "False" !--- make sure only 1 "@" exists --- CFELSEIF Find("@", strEmail, intPosOfAt + 1) CFSET booEmailValid = "False" CFELSEIF intPosOfAt EQ Len(strEmail) CFSET booEmailValid = "False" CFELSEIF Find("@", strEmail, intPosOfAt + 1) !--- more than 1 '@', so this is invalid --- CFSET booEmailValid = "False" CFELSEIF (intPosOfPer EQ 0) OR (intPosOfPer EQ Len(strEmail) CFSET booEmailValid = "False" /CFIF /CFIF CFIF booEmailValid !--- address is OK --- CFELSE !--- address is not OK --- /CFIF Hope this helps, Seth Petry-Johnson Argo Enterprise and Associates -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.