Solved

Regular Expression for entire line in a text file

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

685 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