Function: evil-transform-regexp

evil-transform-regexp is a byte-compiled function defined in evil-common.el.

Signature

(evil-transform-regexp REGEXP REPLACEMENTS-ALIST)

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-common.el
;;; Search
(defun evil-transform-regexp (regexp replacements-alist)
  (replace-regexp-in-string
   "\\\\+[^\\\\]"
   #'(lambda (txt)
       (let* ((b (match-beginning 0))
              (e (match-end 0))
              (ch (aref txt (1- e)))
              (repl (assoc ch replacements-alist)))
         (if (and repl (zerop (mod (length txt) 2)))
             (concat (substring txt b (- e 2))
                     (cdr repl))
           txt)))
   regexp nil t))