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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:55:02+00:00 2026-06-05T08:55:02+00:00

i am stuck at particular problem i have username field where on only alphabets

  • 0

i am stuck at particular problem i have username field where on only alphabets numbers and . – and _ are allowed and should always start with alphabet

here are examples what are accepted

someone@mydomain.com
something1234@mydomain.com
someething.something@mydomain.com
something-something@mydomain.com
something_something@mydomain.com
something_1234@mydomain.com 
something.123@mydomain.com
something-456@mydomain.com

what i have done till now is

[a-zA-Z0-9]+[._-]{1,1}[a-zA-Z0-9]+@mydomain.com

this matches all my requirement except of problem it dosent match

someone@mydomain.com
someont123@mydomain.com

but it even matches

someone_someone_something@mydomain.com 

which is not required i am really not getting how to solve this one thing i tried is

[a-zA-Z0-9]+[._-]{0}[a-zA-Z0-9]+@mydomain.com

but this is also not solving my problem now it accepts everything like

something+455@mydomain.com 

which is not required please help me

  • 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-06-05T08:55:03+00:00Added an answer on June 5, 2026 at 8:55 am

    If you want to make the - or . optional, then you have to replace the {1,1} (quantifier: once) with an ? (quantifier: one or none) here:

     [a-zA-Z0-9]+[._-]?[a-zA-Z0-9]+@mydomain.com
    

    The reason this regex also matches shorter addresses without delimiter -._ is that you don’t assert the whole string, but just some part of it. Use start ^ and end $ anchors:

     ^[a-zA-Z0-9]+[._-]?[a-zA-Z0-9]+@mydomain\.com$
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Kinda stuck here... I have an application with lets say 5000 rows of data
I have a problem using the Java search function in Eclipse on a particular
I am learning C# and stuck on a problem where I have to check
I'm very new to Php OOP and am getting stuck on one particular problem.
Working with OWASP's ESAPI, I found myself stuck at this particular line of code.
I stuck with problem of mail application , i am developing a website for
Im stuck with this little project in C# but basically my problem is this:
im stuck with a problem im basically trying to create a function where I
Got stuck here: http://jsfiddle.net/UFkg8/ Right now the animation is top-down. What do I need
I have a SSRS 2005 report that lists data between two particular dates. I

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.