0

I am trying to remove huge sequence of time stamp on a text file.

It's formatted like this:
Service Commands(04:59)
Using system-config-services(03:49)

I want it to look like this:
Service Commands
Using system-config-services

I tried with the following wild cards ? and * to replace it by just leaving it empty:
Find attempt1:
(??:??)

Find attempt2:
(\**:**)

Replace:



Nothing happens. Am I using the correct wildcards for textmate? What am I missing here?

davidcondrey
  • 34,416
  • 17
  • 114
  • 136
JustinBieber
  • 355
  • 3
  • 5
  • 23

1 Answers1

1

Textmate supports regex. In regex, ? does not match a single character and * does not match multiple characters. Assuming you selected the regex option in the TextMate find dialog, you can match what you're looking for with \(\d\d\.\d\d\). The parentheses and period need to be quoted with the backslash character because they are special characters. \d will match a single digit. See the regex documentation for more operations, such as how to specify how many digits in a row you want to match using *, + or {} notation.

Peter Alfvin
  • 28,599
  • 8
  • 68
  • 106
  • Thanks, your answer was almost 100% correct as I assume that you meant `:` instead of `.` in `\(\d\d\:\d\d\)`. As your example was: `\(\d\d\.\d\d\)`. However, it works and I managed to remove all the time stamps and parentheses. – JustinBieber Sep 28 '13 at 19:06
  • Actually, I meant `\.`, but only because my old eyes/brain didn't see/recognize both dots in the `:` you had all over the place. ;-) Glad it worked out. – Peter Alfvin Sep 28 '13 at 19:09
  • Oh, and I'm pretty sure you don't need to escape the `:` in your regex. – Peter Alfvin Sep 28 '13 at 19:17