regex - Is there an application which highlights findstr matching characters -


i'm working list of files, containing date/time stamps.

those have 2 possible formats:

yyyy/mm/dd hh:mm:ss yyyy-mm-dd hh:mm:ss 

i'd know entries, starting today, half past twelve.

in order this, i've written following regular expression:

"2017[-/]09[-/]12 12:3[0-9]:[0-9][0-9]" 

meaning following:

  • between year, month , day might have 2 possible characters, hence [-/]
  • the timestamp should "12:3x:xx" (somewhere after 12:30, not more 10 minutes later), i've used [0-9].
  • the semicolons treated normal characters, not embedded inside brackets [ or ], i've decided write them without escape character (is there escape character findstr, way?).

to surprise following entries seem fit:

2017/09/12 13:14:36.777|__logfile_|13240|17508|cclass::function|cru|-1|** releasing critical section m_busy 2017/09/12 13:14:36.777|__logfile_|13240|17508|cclass::function|cru|-1|** done function 

i have no clue characters obey regular expression i've written, , prefer not write stackoverflow post @ every issue have findstr, therefore i'd know: there somewhere tool can verify findstr regular expressions , highlights results (so can progressively learning how correct expressions)?

your regex works me. didn't how calling findstr

you need /r (regex) , /c (literal string) flags:

findstr /r /c:"2017[-/]09[-/]12 12:3[0-9]:[0-9][0-9]" logfile.txt 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -