whorsfall
asked on
C# Regular Expression help.
Hi,
I am trying to get my regular expression in C# to extract the following
<![LOG[==========[ ccmsetup started in process 3172 ]==========]LOG]!><time="1 4:32:31.71 7-600"{ date="07-29-2013" component="ccmsetup" context="" type="1" thread="908" file="ccmsetup.cpp:9100">
so it would gather the following:
Capture 1: ==========[ ccmsetup started in process 3172 ]==========
Capture 2: 14:32:31.717-600
Capture 3: 07-29-2013
The problem happens if I have a multi-line entry:
<![LOG[Running installation package
Package: C:\Windows\ccmsetup\Micros oftPolicyP latformSet up.msi
Log: C:\Windows\ccmsetup\Logs\M icrosoftPo licyPlatfo rmSetup.ms i.log
Properties: REBOOT=Suppress ALLUSERS=1]LOG]!><time="14 :33:26.552 -600" date="07-29-2013" component="ccmsetup" context="" type="1" thread="908" file="msiutil.cpp:791">
I have got the following regular expression which almost works - except the new line.
<!\[LOG\[(.*)]LOG]!><time= "(\d{1,2}: \d{1,2}:\d {1,2}.\d{1 ,3}-\d{1,3 })"\sdate= "(\d{1,2}- \d{1,2}-\d {1,4})"
Any suggestions on how to change the expression to make it work.
Thanks,
Ward.
I am trying to get my regular expression in C# to extract the following
<![LOG[==========[ ccmsetup started in process 3172 ]==========]LOG]!><time="1
so it would gather the following:
Capture 1: ==========[ ccmsetup started in process 3172 ]==========
Capture 2: 14:32:31.717-600
Capture 3: 07-29-2013
The problem happens if I have a multi-line entry:
<![LOG[Running installation package
Package: C:\Windows\ccmsetup\Micros
Log: C:\Windows\ccmsetup\Logs\M
Properties: REBOOT=Suppress ALLUSERS=1]LOG]!><time="14
I have got the following regular expression which almost works - except the new line.
<!\[LOG\[(.*)]LOG]!><time=
Any suggestions on how to change the expression to make it work.
Thanks,
Ward.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.