Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a log file with time stamps on each line such as

2012-06-26 21:31:40 Killshot: Something, Something...
2012-06-26 21:31:40 Killed [player name]
2012-06-26 21:31:40 Executing Death Sequence
2012-06-26 21:31:41 Restarting match

I want to replace all the timestamps with blank space in N++. How would I go about having it replace all the different timestamps with that blank space?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can use this expression:

\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}

As suggested by @slhck, one can use \d to replace [0-9], thus reducing the expression.

Notepad++ Print Screen


Having difficulties reading the expression:

\d -> any digit from 0 to 9.
{4} -> four chars count.
\d{4} will search for four numbers.

Repeating this to mach the desired date format, adding the relevant separators like: -, : and , we've got an expression for this problem.

share|improve this answer
1  
You can just use \d for a digit instead of [0-9]. –  slhck Jul 21 '12 at 1:50
    
@slhck Tks, updated! –  Zuul Jul 21 '12 at 2:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.