Simple Regex Request -- TIME
-
Hi
I have a recurring log that needs to be edited regularly to subtract the time element. I will post an example of the log:
[18:16:16] John A: Done. That did not take long.
[18:16:50] Michelle Z: “Any questions so far?”What i want:
John A: Done. That did not take long.
Michelle Z: “Any questions so far?”I attempted to learn the process of creating a Regex but it is all so complicated for me. I did look over several tutorials.
There is no space before the open bracket on each line and there should not be a space before the name when edited.Thank you VERY much for the help!
-
Use
^\[\d{2}:\d{2}:\d{2}\]\sfor searching. Replace with empty string. -
Thank you, thank you, thank you! Not only does it work well but I learned from this and used what I learned already! Your Regex left a space at the beginning of each line because you did not perceive there was an additional space there. I added a \s at the end of it and that got rid of that extra space.
This was very valuable to me.
-
Ah, yes, I assumed a fixed single-space Gap. And to match an arbitrary-length sequence of spaces, try
\s+instead of\s\s.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login