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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:01:47+00:00 2026-06-11T00:01:47+00:00

I am currently writing a script to filter some e-mail contents I’ve received. These

  • 0

I am currently writing a script to filter some e-mail contents I’ve received.

These e-mails are replies to my newsletter campaign, I would like to know who wants to be unsubscribed. For that, I can seek some specific words such as “please”, “remove”, and I also have to check if the e-mail was sent from a mailer-daemon so I can alert the user to change his e-mail address next time he logs in.

First, I have to retrieve the dictionnary from a MySQL database, it contains 77 words at the moment, then I call two preg_match_all function for each word in each mail I process.

I want to check if the entire word \bplease\b can be seen inside the e-mail content, and some people can make a mistake and write the word as “pleease”, then I use \bp+l+e+a+s+e+\b after that.

But the dictionnary is growing up, more and more words are added inside, and the script is getting slower, it’s processing at least 4 emails per second.

Do you have any other way to process the mails faster than now ?

Would it be faster to build a regex matching 77 words instead of executing 77 preg_match_all commands ?

  • 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-11T00:01:49+00:00Added an answer on June 11, 2026 at 12:01 am

    To your question, “Would it be faster to build a regex matching 77 words instead of executing 77 preg_match_all commands ?,” I recommend not using a regex at all. I could be wrong, but I think string functions are faster than regex. Read this: http://www.webdeveloper.com/forum/showthread.php?190485-performance-doubts-regex-vs-string-functions-using-this-and-1-more-doubt!-plz!-) Also read this Which is more efficient, PHP string functions or regex in PHP?

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

Sidebar

Related Questions

I'm currently writing a configure script for a library and would like to package
I am currently writing a small script that checks the contents of each string.
I am currently writing a Python script and trying to dynamically generate some arguments.
I'm currently writing a script, which at some point needs to compare numbers provided
I'm currently writing some installer script that fires SQL files against different database types
In a script I'm currently writing, I create a dedicated user for starting some
I am currently writing a script which parses the ServiceTage, Computername and Username from
I'm currently writing a script editing app in c# to edit game scripts. I
well i am currently writing a script that is meant to check the logs
I'm currently writing a Powershell script that's used to select a user from Active

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.