Solved

Regular Expression for entire line in a text file

Posted on 2010-09-08
2
332 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 23

Author Closing Comment

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…

710 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