Skip to content

Instantly share code, notes, and snippets.

@jccovey
Created December 20, 2011 00:21
Show Gist options
  • Save jccovey/1499575 to your computer and use it in GitHub Desktop.
Save jccovey/1499575 to your computer and use it in GitHub Desktop.
Sublime Text 2 plugin to find and copy all timestamps to a scratch buffer
import sublime, sublime_plugin
class HarvestDates(sublime_plugin.TextCommand):
def run(self, edit):
date_matches = self.view.find_all("\d{1,2}\/\d{1,2}\/\d{4} \d{1,2}:\d{2} (am|pm)")
date_buffer = self.view.window.new_file()
date_buffer.insert(0, 0, date_matches)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment