WIP replace regexp in string
This commit is contained in:
@@ -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 )
|
||||||
|
|||||||
Reference in New Issue
Block a user