Solved

Regular Expression for entire line in a text file

Posted on 2010-09-08
2
327 Views
Last Modified: 2013-11-10
I have a text that I want to read on a daily basis and see if the file contains a certain pattern in a line.
The Line is:
09/06/2010 07:45 AM - Field Import Job: Correspondence Litigation Chargeback (OK) - Finished in 00:00.06
I am able to get the pattern for the date.
 Dim pattern As String = "\b" & (Format(DateValue(Now).AddDays(-1), "MM/dd/yyyy")) 

Open in new window

I want to also look for the (OK)
0
Comment
Question by:yo_bee
2 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 33627431
Try this:


Dim pattern As String = "\b" & (Format(DateValue(Now).AddDays(-1), "MM/dd/yyyy")) & "\b.*\(OK\)"

Open in new window

0
 
LVL 21

Author Closing Comment

by:yo_bee
ID: 33627524
That was the fastest turnaround
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 63
Showdialog 8 21
Format column on datatable 7 18
Help with converting data format in xml file using VB.NET 11 28
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now