Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 940083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:53:48+00:00 2026-05-15T21:53:48+00:00

I have been finding some articles and post which suggest not to use the

  • 0

I have been finding some articles and post which suggest not to use the regular expression to validate user data. I am not sure of all the things but i usually find it in case of email address verification.

So i want to be clear whether using regular expression for validating user input is good or not? if it is good then what is bad with it for validating email address?

Edit:

So can we say that for basic primary validation of data types we can use regex and it is good and for full validation we need to combine it with another parser.

And for second part for email validation in general usage we can use it but as per standard it is not appropriate. Is it?

Now confusion in selecting correct one answer

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:53:48+00:00Added an answer on May 15, 2026 at 9:53 pm

    It’s good because you can use regular expressions to express and test complex patterns in an easy way.

    It’s bad because regular expressions can be complicated and there is much you can do wrong.


    Edit    Well, ok. Here’s some real advice: First make sure that the expected valid values can be expressed using regular expression at all. That is when the language of valid values is a regular language. Otherwise you simply cannot use regular expressions (or at least not regular expressions only)!

    Now that we know what can be validated using regular expressions, we should discuss what is viable to be validated using regular expressions. If we take an e-mail address as an example (like many others did), we should know what a valid e-mail address may look like (see RFC 5322):

    addr-spec       =   local-part "@" domain
    local-part      =   dot-atom / quoted-string / obs-local-part
    domain          =   dot-atom / domain-literal / obs-domain
    domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
    dtext           =   %d33-90 /          ; Printable US-ASCII
                        %d94-126 /         ;  characters not including
                        obs-dtext          ;  "[", "]", or "\"
    

    Here we see that the local-part may consists of a quoted-string that may contain any printable US-ASCII character (excluding \ and "", but including @). So it is not sufficient to test if the e-mail address contains just one @ if we want to allow addresses according to RFC 5322.

    On the other hand, if we want to allow any valid e-mail address according to RFC 5322, we would also allow addresses that do probably not exists or are just senseless in most cases (e.g. ""@localhost).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been facing difficult time finding which browsers support which HTML 5 API
I have some rather dodgy data I'm looking at, and I've been tasked with
I have been finding myself using the Chain of Responsibility pattern often (3 times
I have been tasked with finding an open source DOM XML parser. The parser
I have been experimenting with woopra.com A web analytics tool. Which requires a piece
I have been looking into IKVMing Apache's FOP project to use with our .NET
Our organisation uses inline sql. We have been tasked with providing a suitable data
Hello it has been some time sins i have used Big O notation, so
Have been looking at the MVC storefront and see that IQueryable is returned from
Have been studying the file system related classes of Adobe AIR 1.5, but so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.