Note that there are some explanatory texts on larger screens.

plurals
  1. POMulti-Line group and search with Regex
    primarykey
    data
    text
    <p>Ok, Regex wizards. I want to be able to search through my logfile and find any sessions with the word 'error' in it and then return the entire session log entry.</p> <p>I know I can do this with a string/array but I'd like to learn how to do it with Regex but here's the question. If I decide to do this with Regex do I <a href="http://www.codinghorror.com/blog/archives/001016.html" rel="nofollow noreferrer">have one or two problems</a>? ;o)</p> <p>Here's the log:</p> <p>PS: I'm using the perl Regex engine.</p> <p><strong>Note</strong>: I don't think I can get this done in Regex. In other words, I now have two problems. ;o) I've tried the solutions below but, since I've confused the issue by stating that I was using a Perl engine, many of the answers were in Perl (which cannot be used in my case). I did however post my solution below.</p> <hr> <pre><code>2008.08.27 08:04:21 (Wed)------------Start of Session----------------- Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19) Sending stdin.txt to foo@bar.com Subject: test 1 Login name is foo@bar.com The SMTP server does not require AUTH LOGIN. Are you sure server supports AUTH? The SMTP server does not like the sender name. Have you set your mail address correctly? 2008.08.27 08:04:24 (Wed)-------------End of Session------------------ 2008.08.27 08:05:56 (Wed)------------Start of Session----------------- Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19) Error: Wait a bit (possible timeout). SMTP server error Error: Not a socket. Error: Not a socket. 2008.08.27 08:06:26 (Wed)-------------End of Session------------------ 2008.08.27 08:07:58 (Wed)------------Start of Session----------------- Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19) Sending stdin.txt to foo@bar.com Subject: Lorem Update 08/27/2008 Login name is foo@bar.com 2008.08.27 08:07:58 (Wed)-------------End of Session------------------ </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload