Function: tramp-build-remote-file-name-spec-regexp

tramp-build-remote-file-name-spec-regexp is a byte-compiled function defined in tramp.el.gz.

Signature

(tramp-build-remote-file-name-spec-regexp)

Documentation

Construct a regexp matching a Tramp file name for a Tramp syntax.

It is expected, that tramp-syntax has the proper value.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
;;; File name format:

(defun tramp-build-remote-file-name-spec-regexp ()
  "Construct a regexp matching a Tramp file name for a Tramp syntax.
It is expected, that `tramp-syntax' has the proper value."
  (rx
   ;; Method.
   (group (regexp tramp-method-regexp)) (regexp tramp-postfix-method-regexp)
   ;; Optional user.  This includes domain.
   (? (group (regexp tramp-user-regexp)) (regexp tramp-postfix-user-regexp))
   ;; Optional host.
   (? (group (| (regexp tramp-host-regexp)
                (: (regexp tramp-prefix-ipv6-regexp)
		   (? (regexp tramp-ipv6-regexp))
		   (regexp tramp-postfix-ipv6-regexp)))
   ;; Optional port.
   (? (regexp tramp-prefix-port-regexp) (regexp tramp-port-regexp))))))