WIP replace regexp in string

This commit is contained in:
Willem van den Ende
2023-04-13 08:11:40 +02:00
parent d5c4201e88
commit 3506f61f7f
+7 -2
View File
@@ -6,7 +6,7 @@
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward (rx (one-or-more (category digit))) nil t) (while (re-search-forward (rx (one-or-more (category digit))) nil t)
(replace-match "")))) (replace-match "dada"))))
@@ -19,4 +19,9 @@
(buffer-string)) (buffer-string))
""))) "")))
(ert 'test-chat-remove-hours-ago ) (ert-deftest test-replace-hours-ago-regexp-in-string ()
(should (string=
(replace-regexp-in-string "[0-9]+ hours ago" "" "11 hours ago")
"")))
(ert 'test-replace-regexp-in-string )