Function: hypb:glob-to-regexp

hypb:glob-to-regexp is a byte-compiled function defined in hypb.el.

Signature

(hypb:glob-to-regexp STR)

Documentation

Convert any file glob syntax in STR to Emacs regexp syntax.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hypb.el
(defun hypb:glob-to-regexp (str)
  "Convert any file glob syntax in STR to Emacs regexp syntax."
  (when (stringp str)
    (setq str (replace-regexp-in-string "\\`\\*" ".*" str nil t)
	  str (replace-regexp-in-string "\\([^\\.]\\)\\*" "\\1.*" str))
    (when (and (not (string-match-p "\\(\\$\\|\\\\'\\)\\'" str))
	       (string-match-p "\\.\\S-+\\'" str))
      (setq str (concat str "$"))))
    str)