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-20260414.325/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-localname-regexp "[^[:cntrl:]]*\\'")
(tramp-regexp (car (if (fboundp 'tramp-file-name-structure)
(tramp-file-name-structure)
tramp-file-name-structure))))
(replace-regexp-in-string
"\\\\'" ""
(cond ((string-match-p "\\\\(\\?:^/\\\\)" tramp-regexp)
(replace-regexp-in-string "\\\\(\\?:\\^/\\\\)" "\\(?:/\\)" tramp-regexp nil t))
(t (substring tramp-regexp 1))))))