Skip to main content
AllDevToolsHub
Back to all patterns

URI Scheme Prefix

Web & Network

Matches the scheme part of a URI per RFC 3986.

/^[a-zA-Z][a-zA-Z0-9+.-]*:/

How it works

URI schemes must start with a letter, then alphanumerics or + . -. Useful to detect arbitrary URI prefixes (http, https, file, custom:, data:, javascript:, mailto:).

Test Cases

Should Match

  • http://
  • javascript:alert(1)
  • myapp+xml:foo
  • x-callback-url:

Should NOT Match

  • 1http:
  • ://
  • no-scheme

Quick Summary

Matches the scheme: prefix of a URI per RFC 3986. Useful for cross-protocol detection.