@regexto/validators 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/dist/chunk-DL6DNLHZ.mjs +117 -0
- package/dist/index.d.mts +107 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.js +154 -0
- package/dist/index.mjs +28 -0
- package/dist/zod.d.mts +29 -0
- package/dist/zod.d.ts +29 -0
- package/dist/zod.js +81 -0
- package/dist/zod.mjs +27 -0
- package/package.json +62 -0
- package/patterns/au-abn.json +15 -0
- package/patterns/base64.json +14 -0
- package/patterns/bech32-address.json +14 -0
- package/patterns/bitcoin-address.json +14 -0
- package/patterns/br-cnpj.json +15 -0
- package/patterns/br-cpf.json +15 -0
- package/patterns/cn-resident-id.json +15 -0
- package/patterns/coordinates.json +14 -0
- package/patterns/credit-card.json +14 -0
- package/patterns/crypto-mnemonic-word.json +17 -0
- package/patterns/date-eu.json +14 -0
- package/patterns/date-us.json +14 -0
- package/patterns/datetime-iso.json +14 -0
- package/patterns/de-plz.json +15 -0
- package/patterns/de-steuerid.json +15 -0
- package/patterns/domain.json +14 -0
- package/patterns/email.json +14 -0
- package/patterns/ens-name.json +14 -0
- package/patterns/es-nif.json +15 -0
- package/patterns/ethereum-address.json +14 -0
- package/patterns/fr-postal.json +15 -0
- package/patterns/fr-siren.json +15 -0
- package/patterns/fr-siret.json +15 -0
- package/patterns/git-sha.json +14 -0
- package/patterns/hashtag.json +14 -0
- package/patterns/hex-color.json +14 -0
- package/patterns/hsl-color.json +14 -0
- package/patterns/html-tag.json +14 -0
- package/patterns/iban.json +14 -0
- package/patterns/in-pan.json +15 -0
- package/patterns/ipfs-cid.json +17 -0
- package/patterns/ipv4.json +14 -0
- package/patterns/ipv6.json +14 -0
- package/patterns/iso-date.json +14 -0
- package/patterns/it-codice-fiscale.json +15 -0
- package/patterns/jwt.json +14 -0
- package/patterns/latitude.json +14 -0
- package/patterns/lightning-invoice.json +17 -0
- package/patterns/longitude.json +14 -0
- package/patterns/mac-address.json +14 -0
- package/patterns/markdown-blockquote.json +14 -0
- package/patterns/markdown-bold.json +14 -0
- package/patterns/markdown-code-inline.json +14 -0
- package/patterns/markdown-heading.json +14 -0
- package/patterns/markdown-hr.json +14 -0
- package/patterns/markdown-image.json +14 -0
- package/patterns/markdown-italic.json +14 -0
- package/patterns/markdown-link.json +14 -0
- package/patterns/markdown-list-item.json +14 -0
- package/patterns/markdown-table-row.json +14 -0
- package/patterns/md5.json +14 -0
- package/patterns/mention.json +14 -0
- package/patterns/monero-address.json +14 -0
- package/patterns/password-strong.json +14 -0
- package/patterns/phone-e164.json +14 -0
- package/patterns/phone-uk.json +15 -0
- package/patterns/phone-us.json +15 -0
- package/patterns/pl-nip.json +15 -0
- package/patterns/pl-pesel.json +15 -0
- package/patterns/pl-regon.json +15 -0
- package/patterns/port-number.json +14 -0
- package/patterns/rgb-color.json +14 -0
- package/patterns/ru-inn.json +15 -0
- package/patterns/semver.json +14 -0
- package/patterns/sha256.json +17 -0
- package/patterns/slug.json +14 -0
- package/patterns/solana-address.json +14 -0
- package/patterns/swift-bic.json +14 -0
- package/patterns/time-24h.json +14 -0
- package/patterns/txhash-eth.json +17 -0
- package/patterns/uk-nino.json +15 -0
- package/patterns/uk-postcode.json +15 -0
- package/patterns/url.json +14 -0
- package/patterns/us-ein.json +15 -0
- package/patterns/us-ssn.json +15 -0
- package/patterns/us-zip.json +15 -0
- package/patterns/username.json +14 -0
- package/patterns/uuid.json +14 -0
- package/patterns/youtube-url.json +14 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "rgb-color",
|
|
3
|
+
"name": "RGB Color",
|
|
4
|
+
"description": "Matches an RGB color value in the format rgb(R, G, B) where each channel is 0–255.",
|
|
5
|
+
"category": "Design",
|
|
6
|
+
"pattern": "rgb\\(\\s*(25[0-5]|2[0-4]\\d|1?\\d\\d?)\\s*,\\s*(25[0-5]|2[0-4]\\d|1?\\d\\d?)\\s*,\\s*(25[0-5]|2[0-4]\\d|1?\\d\\d?)\\s*\\)",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["rgb(255, 0, 0)", "rgb(0, 128, 255)", "rgb(74, 222, 128)"],
|
|
9
|
+
"counterExamples": ["rgb(256, 0, 0)", "rgb(0, 0)", "rgba(0, 0, 0, 1)"],
|
|
10
|
+
"tags": ["rgb", "color", "css", "design"],
|
|
11
|
+
"useCases": ["CSS value parsing", "Design tool input", "Color conversion"],
|
|
12
|
+
"seoTitle": "RGB Color Regex — Validate RGB Values in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for CSS RGB color value validation."
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "ru-inn",
|
|
3
|
+
"name": "Russian INN (ИНН)",
|
|
4
|
+
"description": "Matches a Russian taxpayer identification number (ИНН) — 10 digits for organisations, 12 digits for individuals.",
|
|
5
|
+
"category": "Identity",
|
|
6
|
+
"pattern": "(\\d{10}|\\d{12})",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["7707083893", "500100732259"],
|
|
9
|
+
"counterExamples": ["770708389", "77070838930", "770708389A"],
|
|
10
|
+
"locales": ["ru"],
|
|
11
|
+
"tags": ["inn", "russia", "russian", "tax", "identity"],
|
|
12
|
+
"useCases": ["Russian government integration", "Tax reporting", "Business registration"],
|
|
13
|
+
"seoTitle": "Russian INN (ИНН) Regex — Validate INN Numbers",
|
|
14
|
+
"seoDescription": "Regex for Russian taxpayer INN validation. Supports 10-digit and 12-digit formats."
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "semver",
|
|
3
|
+
"name": "Semantic Version",
|
|
4
|
+
"description": "SemVer 2.0 compliant version string including optional pre-release and build metadata.",
|
|
5
|
+
"category": "Dev",
|
|
6
|
+
"pattern": "(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["1.0.0", "2.3.4-alpha.1", "1.0.0+build.1", "0.1.0-beta"],
|
|
9
|
+
"counterExamples": ["1.0", "v1.0.0", "1.0.0.0", "latest"],
|
|
10
|
+
"tags": ["semver", "version", "npm", "development", "ci"],
|
|
11
|
+
"useCases": ["Package version validation", "CI/CD pipeline checks", "Changelog automation"],
|
|
12
|
+
"seoTitle": "SemVer Regex — Validate Semantic Versions in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "SemVer 2.0 regex pattern for validating package version strings. Generate unit tests and code for JavaScript, Go, PHP."
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "sha256",
|
|
3
|
+
"name": "SHA-256 Hash",
|
|
4
|
+
"description": "Matches a SHA-256 cryptographic hash — exactly 64 hexadecimal characters.",
|
|
5
|
+
"category": "Security",
|
|
6
|
+
"pattern": "[a-fA-F0-9]{64}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": [
|
|
9
|
+
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
10
|
+
"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
|
|
11
|
+
],
|
|
12
|
+
"counterExamples": ["abc123", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b85", "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"],
|
|
13
|
+
"tags": ["sha256", "hash", "crypto", "security"],
|
|
14
|
+
"useCases": ["File integrity checks", "Password hashing validation", "API signature verification"],
|
|
15
|
+
"seoTitle": "SHA-256 Hash Regex — Validate SHA256 in JS, Go, PHP",
|
|
16
|
+
"seoDescription": "Regex for SHA-256 hash validation — 64 hex characters."
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "slug",
|
|
3
|
+
"name": "URL Slug",
|
|
4
|
+
"description": "Valid URL slug — lowercase alphanumeric characters separated by single hyphens, no leading or trailing hyphens.",
|
|
5
|
+
"category": "Web",
|
|
6
|
+
"pattern": "[a-z0-9]+(?:-[a-z0-9]+)*",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["my-blog-post", "hello", "article-123", "regex-to"],
|
|
9
|
+
"counterExamples": ["My-Post", "-starts-with-hyphen", "ends-with-hyphen-", "has--double"],
|
|
10
|
+
"tags": ["slug", "url", "web", "cms", "seo"],
|
|
11
|
+
"useCases": ["CMS permalink generation", "URL route validation", "SEO slug sanitization"],
|
|
12
|
+
"seoTitle": "URL Slug Regex — Validate URL Slugs in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for validating URL slugs (lowercase, hyphens, alphanumeric). Generate code for JavaScript, Go, and PHP."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "solana-address",
|
|
3
|
+
"name": "Solana Address",
|
|
4
|
+
"description": "Matches a Solana public key — 32–44 Base58 characters (no 0, O, I, l).",
|
|
5
|
+
"category": "Crypto",
|
|
6
|
+
"pattern": "[1-9A-HJ-NP-Za-km-z]{32,44}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM", "5oNDL3swdJJF1g9DyB2S85EX1fQAUi9sMVndprABjnym"],
|
|
9
|
+
"counterExamples": ["0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe", "short", "contains0orO"],
|
|
10
|
+
"tags": ["solana", "sol", "crypto", "address", "blockchain", "web3"],
|
|
11
|
+
"useCases": ["Solana wallet validation", "DeFi apps", "NFT platforms"],
|
|
12
|
+
"seoTitle": "Solana Address Regex — Validate SOL Addresses",
|
|
13
|
+
"seoDescription": "Regex for Solana public key / wallet address validation (Base58)."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "swift-bic",
|
|
3
|
+
"name": "SWIFT / BIC Code",
|
|
4
|
+
"description": "Matches a SWIFT/BIC (Bank Identifier Code) — 6-letter institution code + 2-letter country + optional 2-3 character branch.",
|
|
5
|
+
"category": "Finance",
|
|
6
|
+
"pattern": "[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["NWBKGB2L", "DEUTDEDB", "BNPAFRPPXXX"],
|
|
9
|
+
"counterExamples": ["NWBKGB", "NWBKGB2LXXXX", "12345678"],
|
|
10
|
+
"tags": ["swift", "bic", "bank", "finance", "wire"],
|
|
11
|
+
"useCases": ["International wire transfers", "SEPA payments", "Bank validation forms"],
|
|
12
|
+
"seoTitle": "SWIFT/BIC Code Regex — Validate Bank Codes",
|
|
13
|
+
"seoDescription": "Regex for SWIFT/BIC bank code validation (8 or 11 characters)."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "time-24h",
|
|
3
|
+
"name": "Time (24-hour)",
|
|
4
|
+
"description": "Matches a time in 24-hour format. Supports both HH:MM and HH:MM:SS.",
|
|
5
|
+
"category": "Date & Time",
|
|
6
|
+
"pattern": "([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["09:30", "23:59:59", "00:00", "12:00:00"],
|
|
9
|
+
"counterExamples": ["25:00", "12:60", "9:5", "24:01"],
|
|
10
|
+
"tags": ["time", "24h", "clock", "datetime"],
|
|
11
|
+
"useCases": ["Scheduling forms", "Calendar apps", "Timetable validation"],
|
|
12
|
+
"seoTitle": "24-Hour Time Regex — Validate HH:MM in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for 24-hour time format validation. Supports HH:MM and HH:MM:SS."
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "txhash-eth",
|
|
3
|
+
"name": "Ethereum Transaction Hash",
|
|
4
|
+
"description": "Matches an Ethereum transaction hash — 0x followed by exactly 64 hexadecimal characters.",
|
|
5
|
+
"category": "Crypto",
|
|
6
|
+
"pattern": "0x[a-fA-F0-9]{64}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": [
|
|
9
|
+
"0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060",
|
|
10
|
+
"0xb5c8bd9430b6cc87a0e2fe110ece6bf527fa4f170a4bc8cd032f768fc5219838"
|
|
11
|
+
],
|
|
12
|
+
"counterExamples": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060", "0xZZZZ"],
|
|
13
|
+
"tags": ["ethereum", "eth", "txhash", "transaction", "blockchain", "crypto"],
|
|
14
|
+
"useCases": ["Block explorer links", "Transaction tracking", "Payment confirmation"],
|
|
15
|
+
"seoTitle": "Ethereum Transaction Hash Regex — Validate TxHash",
|
|
16
|
+
"seoDescription": "Regex for Ethereum transaction hash (0x + 64 hex chars) validation."
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "uk-nino",
|
|
3
|
+
"name": "UK National Insurance Number (NINO)",
|
|
4
|
+
"description": "Matches a UK National Insurance Number in the format AA 99 99 99 A.",
|
|
5
|
+
"category": "Identity",
|
|
6
|
+
"pattern": "[A-CEGHJ-PR-TW-Z]{2}\\s?\\d{2}\\s?\\d{2}\\s?\\d{2}\\s?[A-D]",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["AB 12 34 56 A", "AB123456A", "QQ 12 34 56 C"],
|
|
9
|
+
"counterExamples": ["DA 12 34 56 A", "AB 12 34 56 E", "12 34 56 78 A"],
|
|
10
|
+
"locales": ["en-GB"],
|
|
11
|
+
"tags": ["nino", "uk", "national-insurance", "identity", "british"],
|
|
12
|
+
"useCases": ["UK employment forms", "Tax credit applications", "NHS registration"],
|
|
13
|
+
"seoTitle": "UK NINO Regex — Validate National Insurance Numbers",
|
|
14
|
+
"seoDescription": "Regex for UK National Insurance Number (NINO) validation."
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "uk-postcode",
|
|
3
|
+
"name": "UK Postcode",
|
|
4
|
+
"description": "Matches a UK postcode in the standard format (e.g. SW1A 1AA, EC1A 1BB).",
|
|
5
|
+
"category": "Address",
|
|
6
|
+
"pattern": "[A-Z]{1,2}\\d[A-Z\\d]?\\s?\\d[A-Z]{2}",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["SW1A 1AA", "EC1A 1BB", "W1A 0AX", "M1 1AE", "SW1A1AA"],
|
|
9
|
+
"counterExamples": ["123 456", "ABCD 1EF", "SW1A 1A"],
|
|
10
|
+
"locales": ["en-GB"],
|
|
11
|
+
"tags": ["postcode", "postal", "uk", "british", "address"],
|
|
12
|
+
"useCases": ["UK address forms", "Delivery validation", "Geographic targeting"],
|
|
13
|
+
"seoTitle": "UK Postcode Regex — Validate British Postcodes in JS, Go, PHP",
|
|
14
|
+
"seoDescription": "Regex for UK postcode validation covering all standard formats."
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "url",
|
|
3
|
+
"name": "URL (HTTP/HTTPS)",
|
|
4
|
+
"description": "Validates HTTP and HTTPS URLs including subdomains, paths, query strings, and anchors.",
|
|
5
|
+
"category": "Internet",
|
|
6
|
+
"pattern": "https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&\\/=]*)",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["https://example.com", "http://sub.domain.co/path?q=1#anchor", "https://regex.to"],
|
|
9
|
+
"counterExamples": ["ftp://example.com", "not-a-url", "//missing-protocol.com"],
|
|
10
|
+
"tags": ["url", "internet", "link", "http", "https", "web"],
|
|
11
|
+
"useCases": ["Link validation", "CMS content sanitization", "API endpoint validation"],
|
|
12
|
+
"seoTitle": "URL Regex — Validate HTTP/HTTPS URLs in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Validate HTTP and HTTPS URLs with this regex. Generate ready-to-use code for JavaScript, TypeScript, Go, PHP with unit tests."
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "us-ein",
|
|
3
|
+
"name": "US Employer Identification Number (EIN)",
|
|
4
|
+
"description": "Matches a US EIN (Federal Tax ID) in the NN-NNNNNNN format used by the IRS.",
|
|
5
|
+
"category": "Identity",
|
|
6
|
+
"pattern": "\\d{2}-\\d{7}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["12-3456789", "99-9999999", "01-0000001"],
|
|
9
|
+
"counterExamples": ["123-456789", "1-23456789", "12-345678"],
|
|
10
|
+
"locales": ["en-US"],
|
|
11
|
+
"tags": ["ein", "us", "tax", "employer", "irs", "federal"],
|
|
12
|
+
"useCases": ["Business tax forms", "Contractor onboarding", "Invoice validation"],
|
|
13
|
+
"seoTitle": "US EIN Regex — Validate Employer Identification Numbers",
|
|
14
|
+
"seoDescription": "Regex for US EIN (Federal Tax ID) format validation."
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "us-ssn",
|
|
3
|
+
"name": "US Social Security Number",
|
|
4
|
+
"description": "Matches a US Social Security Number (SSN) in the standard NNN-NN-NNNN format.",
|
|
5
|
+
"category": "Identity",
|
|
6
|
+
"pattern": "\\d{3}-\\d{2}-\\d{4}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["123-45-6789", "001-01-0001", "999-99-9999"],
|
|
9
|
+
"counterExamples": ["123-456-789", "12-34-5678", "123456789"],
|
|
10
|
+
"locales": ["en-US"],
|
|
11
|
+
"tags": ["ssn", "us", "identity", "tax", "american"],
|
|
12
|
+
"useCases": ["US government forms", "Tax filing", "KYC verification"],
|
|
13
|
+
"seoTitle": "US SSN Regex — Validate Social Security Numbers",
|
|
14
|
+
"seoDescription": "Regex for US Social Security Number (SSN) format validation."
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "us-zip",
|
|
3
|
+
"name": "US ZIP Code",
|
|
4
|
+
"description": "Matches a US ZIP code in 5-digit or ZIP+4 (5-4) format.",
|
|
5
|
+
"category": "Address",
|
|
6
|
+
"pattern": "\\d{5}(-\\d{4})?",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["90210", "10001-1234", "00501"],
|
|
9
|
+
"counterExamples": ["1234", "123456", "9021A"],
|
|
10
|
+
"locales": ["en-US"],
|
|
11
|
+
"tags": ["zip", "postal", "us", "address", "american"],
|
|
12
|
+
"useCases": ["US address forms", "Shipping validation", "Geographic targeting"],
|
|
13
|
+
"seoTitle": "US ZIP Code Regex — Validate ZIP Codes in JS, Go, PHP",
|
|
14
|
+
"seoDescription": "Regex for US ZIP code validation. Supports 5-digit and ZIP+4 formats."
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "username",
|
|
3
|
+
"name": "Username",
|
|
4
|
+
"description": "Matches a valid username: 3–20 characters, letters, digits, hyphens, and underscores. No leading/trailing hyphens or underscores.",
|
|
5
|
+
"category": "Social",
|
|
6
|
+
"pattern": "[a-zA-Z0-9](?:[a-zA-Z0-9_\\-]{1,18}[a-zA-Z0-9])?",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["john_doe", "user-123", "alice", "web_dev_42"],
|
|
9
|
+
"counterExamples": ["-john", "john-", "_user", "a", "this_username_is_way_too_long_for_any_system"],
|
|
10
|
+
"tags": ["username", "user", "handle", "login"],
|
|
11
|
+
"useCases": ["User registration", "Social media handles", "API key naming"],
|
|
12
|
+
"seoTitle": "Username Regex — Validate Usernames in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for username validation: alphanumeric, hyphens, underscores, 3–20 chars."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "uuid",
|
|
3
|
+
"name": "UUID v4",
|
|
4
|
+
"description": "Matches a UUID version 4 — randomly generated universally unique identifier in the standard 8-4-4-4-12 format.",
|
|
5
|
+
"category": "Security",
|
|
6
|
+
"pattern": "[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["550e8400-e29b-41d4-a716-446655440000", "6ba7b810-9dad-41d1-80b4-00c04fd430c8"],
|
|
9
|
+
"counterExamples": ["550e8400-e29b-11d4-a716-446655440000", "not-a-uuid", "123e4567-e89b-12d3-a456"],
|
|
10
|
+
"tags": ["uuid", "guid", "identifier", "id"],
|
|
11
|
+
"useCases": ["Database primary keys", "API resource IDs", "Session tokens"],
|
|
12
|
+
"seoTitle": "UUID v4 Regex — Validate UUID in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for UUID v4 validation. Strictly checks version bit and variant bits."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "youtube-url",
|
|
3
|
+
"name": "YouTube Video URL",
|
|
4
|
+
"description": "Matches a YouTube video URL in both youtube.com/watch?v= and youtu.be/ formats and extracts the 11-character video ID.",
|
|
5
|
+
"category": "Internet",
|
|
6
|
+
"pattern": "(?:https?:\\/\\/)?(?:www\\.)?(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/)([a-zA-Z0-9_\\-]{11})",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "youtu.be/dQw4w9WgXcQ", "youtube.com/watch?v=dQw4w9WgXcQ"],
|
|
9
|
+
"counterExamples": ["https://vimeo.com/123456", "https://youtube.com/", "youtu.be/short"],
|
|
10
|
+
"tags": ["youtube", "video", "url", "embed", "social"],
|
|
11
|
+
"useCases": ["Video embed parsers", "Content aggregators", "Link preview generation"],
|
|
12
|
+
"seoTitle": "YouTube URL Regex — Extract Video IDs in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for YouTube URL parsing and video ID extraction."
|
|
14
|
+
}
|