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

  • Home
  • SEARCH
  • 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 5976809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:16:51+00:00 2026-05-22T21:16:51+00:00

i am using a Regular Expression that validates an email address here is the

  • 0

i am using a Regular Expression that validates an email address here is the regular expression i am using.

preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $email)

most of the above code are self explanatory like

a) ^ represents NOT.

b) the start of the string should be either _ a-z 0-9

c) match the next character which starts with dot

d) now what does *@ means here, couldn’t it be just @ which means the next character should be @

e) next again it will try and find dot, the first dot is optional and the second is compulsory.

f) in the end what does $ means?

  • 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-22T21:16:52+00:00Added an answer on May 22, 2026 at 9:16 pm

    Your assumption a) is not true

    ^ is the start of the string in this case. At the beginning of a character class its a NOT.

    [_a-z0-9-]+ will match any of the chars in [] one or more times (because of the +)

    (\.[_a-z0-9-]+)* then there is a dot the same pattern than before and the * means this complete part can be repeated 0 or more times

    Then there has to be the character @

    Then the part from before the @ repeats

    (\.[a-z]{2,3})$ the string has to end (defined by the $) with a . and 2 or 3 lowercase letters

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

Sidebar

Related Questions

Duplicate : Using a regular expression to validate an email address There seem to
Based on this answer... Using a regular expression to validate an email address Which
'123xswer' How to retrieve 123 from the string above without using regular expression?
I need to check the web address, using regular expression. If user type URL
I am looking for help in creating a Regular Expression that validates a URL
I would like to construct a regular expression that matches any letter (including accented
I have found out that I could validate email input using regular expressions. However,
I have some unicode text that I want to clean up using regular expressions.
I'm trying to create a regular expressions that will filter valid emails using PHP
I'm having some trouble using regular expression to get date in a string. Example

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.