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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:28:22+00:00 2026-05-23T05:28:22+00:00

I am trying to do a complicated (to me) regex on a multi-line snip

  • 0

I am trying to do a complicated (to me) regex on a multi-line snip from an e-mail. I have tried hard, with no luck. I am trying to get rid of anything from “On ” through ” wrote:”

Would be nice if you can also check to see if it contains the word “AcmeCompany”, so it doesn’t check for everything “On ” “wrote:”

So far, I have this: /On(.*)AcmeCompany(.*)/im but it does not work…

say hello, world!

On Tue, Jun 7, 2011 at 6:18 AM, AcmeCompany <
24a95f49f7ce573fds2d+c@AcmeCompany.com> wrote:

Thank you for the responses, but it seems like there’s another problem.

EDIT: I found out that this works: /On[\s\S]+?AcmeCompany[\s\S]+?wrote:/m, but it seems to fail when the e-mail contents have word “On”.

say hello, world!

On a plane!    

On Tue, Jun 7, 2011 at 6:18 AM, AcmeCompany <
24a95f49f7ce573fds2d+c@AcmeCompany.com> wrote:

EDIT2: Every mail client is different… gmail tends to do it in 2 lines, mail app from iphone do it in 1 line, so it doens’t always follow the strict format.

1 thing for sure: beginning always uses “On ” and ends with ” wrote:”. It also contains a hash and AcmeCompany, which I can also use to verify.

  • 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-23T05:28:23+00:00Added an answer on May 23, 2026 at 5:28 am

    For the new requirement I am adding another reply. Hope you won’t mind.

    Can you try something like this?

    /On\s(Mon|Tue|Wed|Thu|Fri|Sat)[\s\S]+?AcmeCompany[\s\S]+?wrote:/
    

    I am trying again..how about using ?

    /On.+?AcmeCompany[\s\S]+?wrote:/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to work out a complicated jQuery selection. I have an array,
I have this complicated slider that utilizes tons of animation. I'm trying to find
I have an entry.rb model and I'm trying to make a semi-complicated validation. I
I have a fairly complicated lookup i'm trying to do in Rails and I'm
Yes that sounds overly complicated. I am trying to mine data from pages on
Trying to upgrade a fairly complicated app from rails 3.0 to rails 3.1, suddently
Ok SQL and Oracle gurus I have a somewhat complicated query that I'm trying
I'm trying to do something semi complicated. I have 4 linked images. when I
I have a complicated XML and I am trying to write a XSL transformation
We're trying to build up a minorly complicated Zip file in Gradle from multiple

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.