Solved

Regular Expression for entire line in a text file

Posted on 2010-09-08
2
328 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 22

Author Closing Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

914 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

19 Experts available now in Live!

Get 1:1 Help Now