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 6783711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:54:07+00:00 2026-05-26T16:54:07+00:00

I m just learning regular expression matching using javascript, and have a doubt regarding

  • 0

I m just learning regular expression matching using javascript, and have a doubt regarding the scenario described below.

I’m trying to validate email, with condition below:

Format should be xxx@yyy.zzz where
A) “xxx”, “yyy” and “zzz” parts
can take values only between lowercase a and z
B) The length of zzz,
yyy and xxx parts are arbitrary (should be minimum one though)

Now I understand I can build the regex like this:
EDIT:
CORRECTED REG EXP
/[a-z]+@[a-z]+\.[a-z]+/

and the above would evaluate a string like “aaa@aaa.aaa” as true.

But my concern is, in the above expression if i provide "a999@aaa.aaa", again it would evaluate as true. Now, if i modify the reg ex as **/[a-z]{1,}@[a-z]+\.[a-z]+/** even then it would evaluate "a999@aaa.aaa" as true because of the presence of “a” as the first character.

So, I would like to know how to match the first part “xxx” in the email "xxx@yyy.zzz" in a way that it checks the entire string from first char till it reaches the @ symbol with the condition that it should take only a to z as valid value.

In other words, the regex should not mind the length of the username part of email, and irrespective of the number of chars entered, it should test it based on the specified regex condition, and it should test it for the set of chars from index 1 to index of @.

  • 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-26T16:54:08+00:00Added an answer on May 26, 2026 at 4:54 pm

    Your regular expression will not show a999@aaa.aaa to be a match. It will, however, show that 9999a@aaa.aaa9999 is a match. The regular expression markers you’re missing are ^ for the start of string and $ for end of string. This is what you’re looking for:

    /^[a-z]{1,}@[a-z]+\.[a-z]+$/
    

    You can test this expression out over on this online validator: http://tools.netshiftmedia.com/regexlibrary/#

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

Sidebar

Related Questions

I'm stil pretty new to regular expression and just started learning to use awk.
Im just learning mod_rewrite and regex stuff, and what I'm trying to do is
I am just learning about app.config in respect of creating custom sections. I have
I'm just learning asp.net mvc and I'm trying to figure out how to move
I'm just learning how to do things, and want to start using some sort
I'm using a long regular expression which is pretty hard to grok if you
Im just learning javascript and I'm just wondering why this doesn't work. I've created
I am learning regex ( http://www.regular-expressions.info/ ), and trying to figure out how to
I am just learning server-side JavaScript so please bear with any glaring mistakes I've
just learning as3 for flex. i am trying to do this: var someNumber:String =

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.