diff --git a/mostalive/convert-chats-to-org.el b/mostalive/convert-chats-to-org.el index db8852b..7758ccb 100644 --- a/mostalive/convert-chats-to-org.el +++ b/mostalive/convert-chats-to-org.el @@ -5,19 +5,18 @@ (interactive) (save-excursion (goto-char (point-min)) - (while (re-search-forward "hours ago" nil t) + (while (re-search-forward (rx (one-or-more (category digit))) nil t) (replace-match "")))) (ert-deftest test-chat-remove-hours-ago () (should (string= -(with-temp-buffer - (insert "marcevers\n17 hours ago\n sentence 1\n") + (with-temp-buffer + (insert "17") (goto-char (point-min)) (chat-remove-hours-ago) (buffer-string)) - "marcevers\n17 \n sentence 1\n" -))) + ""))) (ert 'test-chat-remove-hours-ago )