Function: magit--ext-regexp-quote

magit--ext-regexp-quote is a natively 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 /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/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))))