Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to find date time pattern in log file using Regular Expression
    primarykey
    data
    text
    <p>All, I am not really good with Regular expression and trying to find the right tool to use to test this, i use regexpal online tester and don't seem to be getting this:</p> <p>Problem: I have the following Log file that are time stamped : Example: <code>1/27/2012 10:47:50 AM : 0 : ContextManager.Initialize : 0 : Context Manager Initialization Started.</code> </p> <p>I am looking for a Regular Expression that will look through the log file and find the date format as listed above if it finds it i will do additional checking which i am already doing. I just need to get the regex to match the following mentioned above. </p> <p>Here is what i got so far in regards to pattern: </p> <pre><code>@"\d{2,2}/\d{2,2}/\d{4,4} \d{2,2}:\d{2,2}:\d{2,2}"; </code></pre> <p>Main Code: .net c#</p> <pre><code>public void ValidateErrorHandlingMessagesInLogFile() { System.Diagnostics.Debugger.Launch(); //@"\d{2,2}/\d{2,2}/\d{4,4} \d{2,2}:\d{2,2}:\d{2,2}" //^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$ string Pattern = @"\d{2,2}/\d{2,2}/\d{4,4} \d{2,2}:\d{2,2}:\d{2,2}"; ValidateUsingRegularExpression(Pattern, "engine"); } </code></pre> <p>Error Log:</p> <pre><code>1/27/2012 10:47:50 AM : 0 : ContextManager.Initialize : 0 : Context Manager Initialization Started. 1/27/2012 10:47:59 AM : 0 : RuleEngine:538 : 4 : History definition configuration failure. Update history_definition config parameter to resolve errors reported. history definition configuration failure - Unknown field name [Lie_DosFrom] in entry [MEM_DOS] </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload