> I suspect it'd be more efficient to iterate directly on the `match-data` rather > than on an integer (which suffers from an O(N²) complexity). Got it. By using `substring` directly, it looks like this: ```emacs-lisp (when (string-match regexp string)     (let ((matched-data (match-data))           matches beg end)       (while matched-data         (setq beg (pop matched-data))         (setq end (pop matched-data))         (push (and beg end                    (substring string beg end))               matches))       (nreverse matches))) ``` > `save-match-data` is costly and extremely rarely needed. I committed a change that now makes inhibit-modify optional (though `(declare (pure t) (side-effect-free t))` is lost in the process). Although I think intuitively, when running those kind of functions, we naturally expect them not to cause any side-effects from a high-level perspective so `save-match-data` should be the default. -- Daanturo.