MDN self-hosted library · e01.org

URLPattern: port property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const pattern = new URLPattern({ port: "(80|443|8080)" });
console.log(pattern.port); // "(80|443|8080)"
console.log(pattern.test("http://example.com:8080/")); // true