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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:10:40+00:00 2026-05-23T13:10:40+00:00

Please dont downvote the question because of the fact that the answer Im looking

  • 0

Please dont downvote the question because of the fact that the answer Im looking for is not an anser someone should pursue. I’m fully aware of that, but it’s not my idea, I just have to deliver 😀

In cakephp, I have the following dataentry in my model:

    'email' => array(
        'email' => array(
            'rule' => array('email',false,'(^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$)')
        ),
    )

The email rule is a common function in cakephp data validation, and the second and third parameter are optional. The third being the regex. I wasnt happy with the given regex string so I added my own. Now I want to exclude Gmail, Hotmail and yahoo addresses.

How can I change the Regular Expression so those addresses are producing false as result? I cant get it right.

  • 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-23T13:10:40+00:00Added an answer on May 23, 2026 at 1:10 pm

    Why on earth would you want to exclude gmail, hotmail and yahoo addresses? There are plenty of people who only have one of these addresses and no other. This is a bad idea. If you are target a specific “audience” I’d suggest making a list of allowed domains instead.

    Anyway, here’s a functional regex for you which is shorter than the one you already have.. try it out:

    \b[\w\.-]+@((?!gmail|googlemail|yahoo|hotmail).)[\w\.-]+\.\w{2,4}\b
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First please dont overlook because you might think it as common question, this is
I'm not 100% sure how to ask this question so please dont mark me
I am a newbie to BASH so please dont mind my stupid questions because
If you downvote my question, please be KIND enough to leave a reason Hey
I know this may be a low quality question but please dont -rep me
Please, help me. I dont know what is wrong with this code: import android.appwidget.AppWidgetProvider;
Please don't confuse with the title as it was already asked by someone but
Please don't confuse my question with determining the key press. I don't want the
I did a search before asking so please don't tell me to do that.
Apologies in advance because I'm really unsure how to ask this question so if

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.