Function: hpath:tramp-file-name-regexp

hpath:tramp-file-name-regexp is a byte-compiled function defined in hpath.el.

Signature

(hpath:tramp-file-name-regexp)

Documentation

Return a regexp for matching to the beginning of a remote file name.

Modifies tramp-file-name-regexp by removing bol anchor and match to empty string if present.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260923.1433/hpath.el
(defun hpath:tramp-file-name-regexp ()
  "Return a regexp for matching to the beginning of a remote file name.
Modifies `tramp-file-name-regexp' by removing bol anchor and
match to empty string if present."
  (let ((tramp-regexp (car tramp-file-name-structure)))
    (cond
     ((string-prefix-p "^/" tramp-regexp)
      (substring tramp-regexp 1))
     ((string-prefix-p "\\(?:^/\\)" tramp-regexp)
      (concat "/" (substring tramp-regexp (length "\\(?:^/\\)"))))
     ((string-prefix-p "\\(?:\\`/\\)" tramp-regexp)
      (concat "/" (substring tramp-regexp (length "\\(?:\\`/\\)"))))
     (t
      (error "Unexpected TRAMP file name regexp: %S" tramp-regexp)))))