Is there a standard for protocol names in URIs e.g. http: or file:? I’m trying to develop a regex that will detect if a URI starts with a protocol name but I’m not sure what characters are allowed there.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
RFC 3986, section 3.1 has the grammar:
Which means protocol names must start with a letter, and can be followed by any number of letters, numbers, or
+,-or.symbols. Protocol names are case-insensitive (that is,HTTPandhttpshould be treated the same), but generally they should be canonicalized to lowercase forms (soHTTPshould becomehttp).