Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Need Regex Guru - problem with email regex and French emailsNeed Regex Guru - problem with email regex and French emails
Previous
 
Next
New Post
5/16/2007 4:45 AM
 

Hi All,

 

A user complained that they could not sign up to PokerDIY as it kept saying "Invalid Email". Their email is

"********-22@hotmail.fr"

(8 normal chars instead of the *)

I think it is the "-22" that the filter is not liking (and this is a valid address as he emailed me using it).

So - firstly, can anyone help me with the RegEx expression please - I only know the basics!

and Secondly - it would be nice to get the fix shipped in the core - there may be a lot of people not signing up without knowing it (I found the person's complaint by accident on a French Forum using Google!).

 


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
5/16/2007 4:46 AM
 

ps - my current RegEx email validation is - "\b[a-zA-Z0-9._%-+']+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b"

This is the shipped on on DNN 4.5.1 I assume.

It's all Regex to me...


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
5/16/2007 6:27 AM
 

The problem occurs because of the way some characters are treated when inside a character class [ ].  If you look at the character class [a-zA-Z0-9._%-+'] notice the expression 'a-z' this means to include all characters in the range 'a to z'.  Somehow I don't think that the original author intended for %-+ to designate a range, which would include parenthesis, asterisk and a few other invalid characters in an email address?  Instead that portion of the regex should have been %\-+ the backslash is an escape character and tells the regex engine to treat the dash as a regular character and ignore its special meaning.  The final regex should look like this:

\b[a-zA-Z0-9._%\-+']+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b


Joe Brinkman
DNN Corp.
 
New Post
5/16/2007 7:14 AM
 

Joe,

Thanks for the quick and informative answer - that now works. For anyone reading this, you should change your Email Validation expression to this just in case (it's quite a rare scenario - the user did not have another email account so just did not sign up).


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
5/16/2007 10:53 AM
 

That is a great fix! 

Also for those interested I have a regEx tester tool that you can use to see how your regex will function on my site at http://www.mitchelsellers.com under the Tools menu option.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Need Regex Guru - problem with email regex and French emailsNeed Regex Guru - problem with email regex and French emails


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out