branch: externals/iso-date
commit 899003fcfcfd193ec66658d6d6f20f7abea30b29
Author: Lucas Quintana <lm...@protonmail.com>
Commit: Lucas Quintana <lm...@protonmail.com>

    Convert a plain regexp to rx format
---
 iso-date.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/iso-date.el b/iso-date.el
index 657b977e1b..80fd86215e 100644
--- a/iso-date.el
+++ b/iso-date.el
@@ -149,7 +149,11 @@ that format.
 
 This is an alternative to the plist-based modification offered by
 `iso-date'."
-  (when (string-match "\\`[ \t]*\\([+-]?[0-9]+\\)\\([a-z]\\)[ \t]*\\'" shift)
+  (when (string-match
+         (rx
+          (group (optional (or "+" "-")) (one-or-more digit))
+          (group (any letter)))
+         shift)
     (let ((num (string-to-number (match-string-no-properties 1 shift)))
           (unit (match-string-no-properties 2 shift)))
       (iso-date

Reply via email to