Function: magit--ext-regexp-quote

magit--ext-regexp-quote is a byte-compiled function defined in magit-base.el.

Signature

(magit--ext-regexp-quote STRING)

Documentation

Like reqexp-quote, but for Extended Regular Expressions.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-base.el
(defun magit--ext-regexp-quote (string)
  "Like `reqexp-quote', but for Extended Regular Expressions."
  (let ((special (string-to-list "[*.\\?+^$({"))
        (quoted nil))
    (dolist (char string)
      (when (memq char special)
        (push ?\\ quoted))
      (push char quoted))
    (concat (nreverse quoted))))