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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:45:30+00:00 2026-06-09T19:45:30+00:00

Trying to archive a regexp to filter bounced emails differing them from SPAM or

  • 0

Trying to archive a regexp to filter bounced emails differing them from SPAM or temporary undeliverable.

Our idea is to grab certain words the expression could contain (code + word) but ignore the whole line if it contans others such as (SPAM|temporarily undeliverable|disk quota exceeded) etc, as this would not be considered permanent bounces. We’ve managed the first part and found a couple of answers here about negative regexp (http://stackoverflow.com/questions/1153856/string-negation-using-regular-expressions) but been completely unsuccessful in mixing both in one group sentence so far.

Something like:

.*(5.3.0|5.1.0).*(User unknown|invalid|Unknown address|doesn't have a)

but not match if anywhere else on the same line contains xxx words. Something like:

^(?!(SPAM|temporarily undeliverable|disk quota exceeded)).*$

So the following first line would match but the second should not

Diagnostic-Code: smtp; 5.3.0 – Other mail system problem 554-“delivery
error: dd This user doesn’t have a btinternet.com account
(xxxxxxxx@xxxxxinternet.com) [0] – mta1000.bt.mail.ird.yahoo.com”
(delivery attempts: 0)

Diagnostic-Code: smtp; 5.1.0 – Unknown address error 550-‘RCPT
TO: Mailbox disk quota exceeded’ (delivery
attempts: 0)

  • 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-09T19:45:31+00:00Added an answer on June 9, 2026 at 7:45 pm

    You are searching only at the start of the string for your negation. You just need to add a .*

    try

    ^(?!.*(SPAM|temporarily undeliverable|disk quota exceeded)).*(5.3.0|5.1.0).*(User unknown|invalid|Unknown address|doesn't have a)
    

    See it here on Regexr

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

Sidebar

Related Questions

I'm trying to stream video content from a RAR archive. and it goes fine
I'm trying to archive records from a table in a database to an identical
I am trying to archive a set of files from the source path to
I'm trying to use SharpZipLib to pull specified files from a zip archive. All
I am trying to implement a rails Recipe application from the site http://oreilly.com/ruby/archive/rails-revisited.html .
I am trying to archive my MonoTouch app and to supply it to our
I was trying to sign a jar applet archive with our company .pfx certificate
I am trying to load a bitmap from an archive. The bitmap class I
I'm trying to create a TAR archive from my program and then opening the
Trying to archive some data from one database table to another over linked server

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.