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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:55:11+00:00 2026-05-25T23:55:11+00:00

I have this file/string: —– Transcript of session follows —– … while talking to

  • 0

I have this file/string:

   ----- Transcript of session follows -----
... while talking to mta6.am0.yahoodns.net.:
>>> DATA
<<< 554 delivery error: dd Sorry your message to foo@yahoo.com cannot be delivered. This account has been disabled or discontinued [#102]. - mta1070.mail.ac4.yahoo.com
554 5.0.0 Service unavailable

--p94IAEl4012027.1317751814/foo.com


   ----- Transcript of session follows -----
... while talking to mail.messaging.microsoft.com.:
>>> DATA
<<< 550 5.7.1 Service unavailable; Client host [foo] blocked using Blocklist 2, mail from IP banned; To request removal from this list please forward this message to foo@foo.com.
550 5.1.1 <foo@foo.com>... User unknown
<<< 503 5.5.2 Need rcpt command

--p94I91SC011973.1317751741/foo.com
Content-Type: message/delivery-status

And I need to get the part after “transcript of session follows—“, up to the blank new line (or double new_line I think).

I tried something like this

<?php preg_match("/----- Transcript of session follows -----\n(.*)\n\n/",$email, $transcript_matches);?>

but is incorrect, instead of .* I probably need any char OR new line but NOT two new lines. And right after it two new lines. How can I write that?

Thank you.

  • 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-25T23:55:12+00:00Added an answer on May 25, 2026 at 11:55 pm

    Two things:

    • You need to use the //s modifier to specify that . can match newlines. See http://php.net/manual/en/reference.pcre.pattern.modifiers.php for details on regex modifiers in php.
    • Use .*? to specify a non-greedy match (it will match the shortest string it finds).

    Putting it together:

    <?php preg_match("/----- Transcript of session follows -----\n(.*?)\n\n/s",$email, $transcript_matches);?>
    

    Also note: If you are trying to get “–p94IAEl4012027.1317751814/foo.com” as part of your results, then notice that it is three newlines lines you are looking for, not two. In other words: two blank lines == three newline characters.

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

Sidebar

Related Questions

I have this: Dim myTemp As String myTemp = System.DateTime.Now().ToString(MMMddyyyy_HHmmss) & .pdf System.IO.File.Copy(myFile, c:\
I have an XML file, which I open in F# like this: let Bookmarks(xmlFile:string)
So I have this GIF file on my desktop (it's a 52 card deck
So I have this .htaccess file in the /blog/ folder on my webserver and
I have this tiny Qt project with a project file like this: TEMPLATE =
Say I have this given XML file: <root> <node>x</node> <node>y</node> <node>a</node> </root> And I
This is driving me crazy. I have this one php file on a test
I have this function to read in all ints from the file. The problem
I have some code that effectively does this : File file = new File(C:\\Program
I have this on line 56 in my environment.rb: I18n.load_path += Dir[ File.join(RAILS_ROOT, 'lib',

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.