Re: Apostrophes in email addresses
Have you checked cflib.org,. I have defo seen such a regex somewhere Regards Russ Michaels www.michaels.me.uk www.cfmldeveloper.com - Free CFML hosting for developers www.cfsearch.com - CF search engine On Feb 25, 2013 7:46 AM, .jonah jonah@creori.com wrote: And you know what, I glossed over that sentence before replying. :O On 2/24/13 8:06 PM, Adam Cameron wrote: Absolutely mate. I did make sure to point that out: That said, this is the fault of the original regex, not your fix for it. (Yes, I did see the smiley too though ;-) On 25 February 2013 15:00, .jonah jonah@creori.com wrote: I take issue! ;) Kevin simply asked to his regex working with an apostrophie. My answer did that. He didn't ask for the be-all-end-all of email validators. Now, as to the rest of your comment and blog post, I'm in agreement. It's rarely done correctly. (Not accounting for plus addressing often annoys me.) However, writing an RFC compliant parser is quite possible and someone should probably do it. However, trying to build something that would work 100% out in the wild would probably be futile. On 2/24/13 11:12 AM, Adam Cameron wrote: This seems to work, no? No. It doesn't allow for quite a number of completely legit characters, notably the + sign (which is very common), amongst others. That said, this is the fault of the original regex, not your fix for it. My feedback on this got too long for a response here, so I wrote it up on my blog: http://adamcameroncoldfusion.blogspot.co.uk/2013/02/email-address-validation-1-in-series.html ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354675 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Apostrophes in email addresses
I've been using the drop down email validation for years without dramas until now. ++ Kevin Parker m: 0418 815 527 ++ -Original Message- From: Justin Scott [mailto:leviat...@darktech.org] Sent: Sunday, 24 February 2013 7:31 PM To: cf-talk Subject: Re: Apostrophes in email addresses 100% of the time this little bit of regex has served me well until now. ^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$ Is there a reason you're not using the built in isValid(email, variable) function instead of a regex? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354676 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Apostrophes in email addresses
Thank you for that and all the other responses too I suppose I'm guilty - I was just doing it because you do and always have. I hadn't really thought of it this way Adam and now I suspect I'll ask the question each time - do I need to validate this address. I suppose some understanding of who is entering the data is a consideration for me too - because when it breaks they call me because it's the app, not them :-) ++ Kevin Parker ++ -Original Message- From: Adam Cameron [mailto:adamcameroncoldfus...@gmail.com] Sent: Monday, 25 February 2013 6:12 AM To: cf-talk Subject: Re: Apostrophes in email addresses This seems to work, no? No. It doesn't allow for quite a number of completely legit characters, notably the + sign (which is very common), amongst others. That said, this is the fault of the original regex, not your fix for it. My feedback on this got too long for a response here, so I wrote it up on my blog: http://adamcameroncoldfusion.blogspot.co.uk/2013/02/email-address-validation -1-in-series.html -- Adam ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354677 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
Hey Kevin, one think I hope you got was that my blog post was not aimed specifically at you or anything in this thread, it was just the discussion was the catalyst for me to write something out. I use these forums as writing inspiration sometimes, so it was kinda oh yeah! I have an opinion on that! more than anything else. [I stand by what I say, obviously ;-) ] -- Adam On 25 February 2013 22:12, Kevin Parker tras...@internode.on.net wrote: Thank you for that and all the other responses too I suppose I'm guilty - I was just doing it because you do and always have. I hadn't really thought of it this way Adam and now I suspect I'll ask the question each time - do I need to validate this address. I suppose some understanding of who is entering the data is a consideration for me too - because when it breaks they call me because it's the app, not them :-) ++ Kevin Parker ++ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354678 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Apostrophes in email addresses
No problem at all - I read your article end to end and it made me think about (in some ways challenge) something I'm doing and that's a good thing - as I said I have always validated emails addresses because I always have, and when I thought about it, it was but for no other reason than I always have. Then I thought do I really need to do this - I'll take a more app by app approach in future. ++ Kevin Parker ++ -Original Message- From: Adam Cameron [mailto:adamcameroncoldfus...@gmail.com] Sent: Monday, 25 February 2013 8:54 PM To: cf-talk Subject: Re: Apostrophes in email addresses Hey Kevin, one think I hope you got was that my blog post was not aimed specifically at you or anything in this thread, it was just the discussion was the catalyst for me to write something out. I use these forums as writing inspiration sometimes, so it was kinda oh yeah! I have an opinion on that! more than anything else. [I stand by what I say, obviously ;-) ] -- Adam On 25 February 2013 22:12, Kevin Parker tras...@internode.on.net wrote: Thank you for that and all the other responses too I suppose I'm guilty - I was just doing it because you do and always have. I hadn't really thought of it this way Adam and now I suspect I'll ask the question each time - do I need to validate this address. I suppose some understanding of who is entering the data is a consideration for me too - because when it breaks they call me because it's the app, not them :-) ++ Kevin Parker ++ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354679 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
100% of the time this little bit of regex has served me well until now. ^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$ Is there a reason you're not using the built in isValid(email, variable) function instead of a regex? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354663 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
Pretty sure isValid() incorrectly flags emails with apostrophes as invalid. There are two or three bugs with isValid() and emails. On Feb 24, 2013 7:05 AM, Justin Scott leviat...@darktech.org wrote: 100% of the time this little bit of regex has served me well until now. ^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$ Is there a reason you're not using the built in isValid(email, variable) function instead of a regex? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354664 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
Still? Regards Russ Michaels www.michaels.me.uk www.cfmldeveloper.com - Free CFML hosting for developers www.cfsearch.com - CF search engine On Feb 24, 2013 3:24 PM, Matt Quackenbush quackfu...@gmail.com wrote: Pretty sure isValid() incorrectly flags emails with apostrophes as invalid. There are two or three bugs with isValid() and emails. On Feb 24, 2013 7:05 AM, Justin Scott leviat...@darktech.org wrote: 100% of the time this little bit of regex has served me well until now. ^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$ Is there a reason you're not using the built in isValid(email, variable) function instead of a regex? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354665 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
This seems to work, no? No. It doesn't allow for quite a number of completely legit characters, notably the + sign (which is very common), amongst others. That said, this is the fault of the original regex, not your fix for it. My feedback on this got too long for a response here, so I wrote it up on my blog: http://adamcameroncoldfusion.blogspot.co.uk/2013/02/email-address-validation-1-in-series.html -- Adam ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354666 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
Pretty sure isValid() incorrectly flags emails with apostrophes as invalid. Nope, at least not with CF9 (checked last night before I posted). There are two or three bugs with isValid() and emails. I was about to ask if anyone had details on where isValid() might fail on e-mail addresses when I saw that Adam wrote up a blog entry in reference to this thread at http://adamcameroncoldfusion.blogspot.com/2013/02/email-address-validation-1-in-series.html which outlines a bunch of possibilities with tests run on CF10. As noted isValid() will work with the most common special characters I see in the wild (notably + and '). He points out a slew of others that fail though I don't recall ever seeing most of those in use after more than a decade in the industry (not to say they aren't out there, just very, very rare). He notes that there is a bug open on this with a will fix note so it'll just get better in future patches/versions. -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354667 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
I take issue! ;) Kevin simply asked to his regex working with an apostrophie. My answer did that. He didn't ask for the be-all-end-all of email validators. Now, as to the rest of your comment and blog post, I'm in agreement. It's rarely done correctly. (Not accounting for plus addressing often annoys me.) However, writing an RFC compliant parser is quite possible and someone should probably do it. However, trying to build something that would work 100% out in the wild would probably be futile. On 2/24/13 11:12 AM, Adam Cameron wrote: This seems to work, no? No. It doesn't allow for quite a number of completely legit characters, notably the + sign (which is very common), amongst others. That said, this is the fault of the original regex, not your fix for it. My feedback on this got too long for a response here, so I wrote it up on my blog: http://adamcameroncoldfusion.blogspot.co.uk/2013/02/email-address-validation-1-in-series.html ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354668 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
Something tangential to keep in mind is BE CONSISTENT. I've come across numerous instances out there where different features on a site don't have the same validation. For example, the account creation process might accept an email address with a plus sign in it, but the password reset function rejects it. Whoops! Whatever validation method you choose, use the same one across your entire app. On 2/24/13 12:21 PM, Justin Scott wrote: Pretty sure isValid() incorrectly flags emails with apostrophes as invalid. Nope, at least not with CF9 (checked last night before I posted). There are two or three bugs with isValid() and emails. I was about to ask if anyone had details on where isValid() might fail on e-mail addresses when I saw that Adam wrote up a blog entry in reference to this thread at http://adamcameroncoldfusion.blogspot.com/2013/02/email-address-validation-1-in-series.html which outlines a bunch of possibilities with tests run on CF10. As noted isValid() will work with the most common special characters I see in the wild (notably + and '). He points out a slew of others that fail though I don't recall ever seeing most of those in use after more than a decade in the industry (not to say they aren't out there, just very, very rare). He notes that there is a bug open on this with a will fix note so it'll just get better in future patches/versions. -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354669 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
Absolutely mate. I did make sure to point that out: That said, this is the fault of the original regex, not your fix for it. (Yes, I did see the smiley too though ;-) On 25 February 2013 15:00, .jonah jonah@creori.com wrote: I take issue! ;) Kevin simply asked to his regex working with an apostrophie. My answer did that. He didn't ask for the be-all-end-all of email validators. Now, as to the rest of your comment and blog post, I'm in agreement. It's rarely done correctly. (Not accounting for plus addressing often annoys me.) However, writing an RFC compliant parser is quite possible and someone should probably do it. However, trying to build something that would work 100% out in the wild would probably be futile. On 2/24/13 11:12 AM, Adam Cameron wrote: This seems to work, no? No. It doesn't allow for quite a number of completely legit characters, notably the + sign (which is very common), amongst others. That said, this is the fault of the original regex, not your fix for it. My feedback on this got too long for a response here, so I wrote it up on my blog: http://adamcameroncoldfusion.blogspot.co.uk/2013/02/email-address-validation-1-in-series.html ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354672 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
And you know what, I glossed over that sentence before replying. :O On 2/24/13 8:06 PM, Adam Cameron wrote: Absolutely mate. I did make sure to point that out: That said, this is the fault of the original regex, not your fix for it. (Yes, I did see the smiley too though ;-) On 25 February 2013 15:00, .jonah jonah@creori.com wrote: I take issue! ;) Kevin simply asked to his regex working with an apostrophie. My answer did that. He didn't ask for the be-all-end-all of email validators. Now, as to the rest of your comment and blog post, I'm in agreement. It's rarely done correctly. (Not accounting for plus addressing often annoys me.) However, writing an RFC compliant parser is quite possible and someone should probably do it. However, trying to build something that would work 100% out in the wild would probably be futile. On 2/24/13 11:12 AM, Adam Cameron wrote: This seems to work, no? No. It doesn't allow for quite a number of completely legit characters, notably the + sign (which is very common), amongst others. That said, this is the fault of the original regex, not your fix for it. My feedback on this got too long for a response here, so I wrote it up on my blog: http://adamcameroncoldfusion.blogspot.co.uk/2013/02/email-address-validation-1-in-series.html ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354674 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Apostrophes in email addresses
This seems to work, no? ^[A-Za-z0-9_\'\.-]{1,}\@([[:digit:]a-zA-Z-]{1,}\.){1,}[[:digit:]a-zA-Z-]+$ I added \' before the \. in the first set. On 2/22/13 11:30 PM, Kevin Parker wrote: As much as I wonder why you would do it apparently the odd network admin does and its valid. 100% of the time this little bit of regex has served me well until now. ^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$ But I have a need to validate an email address that has an apostrophe before the @ e.g. fred.o'ke...@annoyingemailaddresses.com - I've tried a variety of suggestions but all have caused errors in CF. The context I'm using it in is. CFIF REFindNoCase(^[A-Za-z0-9_\.-]{1,}\@([[:digit:]a-zA-Z-]{1,}\.){1,}[[:digit:] a-zA-Z-]+$ , TheEmailAddress) EQ 0 I found this which took a standards based approach but they error in CF - http://www.regular-expressions.info/email.html I wonder if any you good folk have a little bit of regex or suggestions that might fix this annoying little problem. Thank you. ++ Kevin Parker m: 0418 815 527 ++ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354661 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Apostrophes in email addresses
Worked a treat - thankyou - I think I was trying to over engineer the solution :-) ++ Kevin Parker m: 0418 815 527 ++ -Original Message- From: .jonah [mailto:jonah@creori.com] Sent: Sunday, 24 February 2013 7:21 AM To: cf-talk Subject: Re: Apostrophes in email addresses This seems to work, no? ^[A-Za-z0-9_\'\.-]{1,}\@([[:digit:]a-zA-Z-]{1,}\.){1,}[[:digit:]a-zA-Z-]+$ I added \' before the \. in the first set. On 2/22/13 11:30 PM, Kevin Parker wrote: As much as I wonder why you would do it apparently the odd network admin does and its valid. 100% of the time this little bit of regex has served me well until now. ^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$ But I have a need to validate an email address that has an apostrophe before the @ e.g. fred.o'ke...@annoyingemailaddresses.com - I've tried a variety of suggestions but all have caused errors in CF. The context I'm using it in is. CFIF REFindNoCase(^[A-Za-z0-9_\.-]{1,}\@([[:digit:]a-zA-Z-]{1,}\.){1,}[[:d igit:] a-zA-Z-]+$ , TheEmailAddress) EQ 0 I found this which took a standards based approach but they error in CF - http://www.regular-expressions.info/email.html I wonder if any you good folk have a little bit of regex or suggestions that might fix this annoying little problem. Thank you. ++ Kevin Parker m: 0418 815 527 ++ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354662 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm