Regex Pack: URLs and the Web
A 1-page snippet pack for working with URLs and web strings: 10 short entries with copy-ready code.
ForDevelopers
// HTTP or HTTPS URL
const pattern = /^https?:\/\/[^\s/$.?#][^\s]*$/;
pattern.test("https://example.com/a?b=1"); // true
// Domain name
const pattern = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/i;
pattern.test("example.com"); // true
// Query parameter
const pattern = /[?&]page=(\d+)/;What's inside
- Format
- PDF, Markdown, JS
- Contents
- 10 patterns
- Version
- 1.0 · Updated 3 Oct 2026
- Licence
- Commercial What this means
- Checked
- Checked before it ships
- regex-pack-urls-and-web.pdfPDF · 20 KB
- regex-pack-urls-and-web.mdMarkdown · 1 KB
- regex-pack-urls-and-web.jsJS · 858 B
- LICENSE.txtadded to every download
About this item
A compact, printable snippet pack for working with URLs and web strings. Each of the 10 entries has a one-line explanation and a small example you can paste into your editor. The PDF uses a two-column A4 layout designed to sit next to your keyboard, and the same content ships as Markdown so you can search it or drop it into your notes, plus a JavaScript module that exports every pattern. Every JavaScript example targets ES2023.
Reviews
No reviews yet.