@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": "hashtag",
|
|
3
|
+
"name": "Hashtag",
|
|
4
|
+
"description": "Matches a social media hashtag — # followed by one or more word characters (letters, digits, underscores), starting with a letter.",
|
|
5
|
+
"category": "Social",
|
|
6
|
+
"pattern": "#[A-Za-z][A-Za-z0-9_]*",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["#regex", "#WebDev2024", "#hello_world", "#TypeScript"],
|
|
9
|
+
"counterExamples": ["#123abc", "# space", "#", "notahashtag"],
|
|
10
|
+
"tags": ["hashtag", "social", "twitter", "instagram", "tag"],
|
|
11
|
+
"useCases": ["Social media parsing", "Content tagging", "Trending topics"],
|
|
12
|
+
"seoTitle": "Hashtag Regex — Parse Hashtags in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for hashtag extraction from social media text."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "hex-color",
|
|
3
|
+
"name": "Hex Color",
|
|
4
|
+
"description": "CSS hex color code in #RGB or #RRGGBB format (case-insensitive).",
|
|
5
|
+
"category": "Web",
|
|
6
|
+
"pattern": "#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["#fff", "#FFF", "#a3B2c1", "#000000", "#FF5733"],
|
|
9
|
+
"counterExamples": ["#gggggg", "#12345", "fff", "rgb(255,0,0)"],
|
|
10
|
+
"tags": ["color", "css", "hex", "web", "frontend", "design"],
|
|
11
|
+
"useCases": ["CSS preprocessor tooling", "Design token validation", "Color picker inputs"],
|
|
12
|
+
"seoTitle": "Hex Color Regex — Validate CSS Hex Colors in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex pattern for validating CSS hex color codes (#RGB and #RRGGBB). Generate code for JavaScript, TypeScript, Go, PHP."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "hsl-color",
|
|
3
|
+
"name": "HSL Color",
|
|
4
|
+
"description": "Matches a CSS HSL color value in the format hsl(H, S%, L%).",
|
|
5
|
+
"category": "Design",
|
|
6
|
+
"pattern": "hsl\\(\\s*(360|3[0-5]\\d|[12]\\d{2}|[1-9]\\d|\\d)\\s*,\\s*(100|[1-9]\\d|\\d)%\\s*,\\s*(100|[1-9]\\d|\\d)%\\s*\\)",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["hsl(0, 100%, 50%)", "hsl(142, 70%, 55%)", "hsl(224, 10%, 9%)"],
|
|
9
|
+
"counterExamples": ["hsl(361, 100%, 50%)", "hsl(0, 101%, 50%)", "rgb(255, 0, 0)"],
|
|
10
|
+
"tags": ["hsl", "color", "css", "design"],
|
|
11
|
+
"useCases": ["CSS value parsing", "Theme generators", "Color pickers"],
|
|
12
|
+
"seoTitle": "HSL Color Regex — Validate HSL Values in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for CSS HSL color value validation."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "html-tag",
|
|
3
|
+
"name": "HTML Tag",
|
|
4
|
+
"description": "Matches an HTML opening or self-closing tag with optional attributes.",
|
|
5
|
+
"category": "Web",
|
|
6
|
+
"pattern": "<([a-zA-Z][a-zA-Z0-9]*)\\b[^>]*\\/?>",
|
|
7
|
+
"flags": "g",
|
|
8
|
+
"examples": ["<div>", "<img src=\"photo.jpg\" alt=\"Photo\" />", "<input type=\"text\" class=\"form-control\">"],
|
|
9
|
+
"counterExamples": ["</div>", "<!-- comment -->", "<123invalid>"],
|
|
10
|
+
"tags": ["html", "tag", "web", "parsing", "dom"],
|
|
11
|
+
"useCases": ["HTML sanitization", "Template parsing", "Web scraping"],
|
|
12
|
+
"seoTitle": "HTML Tag Regex — Match HTML Tags in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for matching HTML opening and self-closing tags with attributes."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "iban",
|
|
3
|
+
"name": "IBAN",
|
|
4
|
+
"description": "Matches an International Bank Account Number (IBAN) — 2-letter country code, 2 check digits, and up to 30 alphanumeric characters.",
|
|
5
|
+
"category": "Finance",
|
|
6
|
+
"pattern": "[A-Z]{2}\\d{2}[A-Z0-9]{4}\\d{7}([A-Z0-9]?){0,16}",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["GB29NWBK60161331926819", "DE89370400440532013000", "PL61109010140000071219812874"],
|
|
9
|
+
"counterExamples": ["123456789", "GB29 NWBK", "XX29NWBK60161331926819"],
|
|
10
|
+
"tags": ["iban", "bank", "finance", "international", "account"],
|
|
11
|
+
"useCases": ["International wire transfers", "Bank account validation", "Finance forms"],
|
|
12
|
+
"seoTitle": "IBAN Regex — Validate International Bank Account Numbers",
|
|
13
|
+
"seoDescription": "Regex for IBAN validation. Covers all countries and IBAN lengths."
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "in-pan",
|
|
3
|
+
"name": "Indian PAN Card",
|
|
4
|
+
"description": "Matches an Indian Permanent Account Number (PAN) — 10 characters: 5 uppercase letters, 4 digits, 1 uppercase letter.",
|
|
5
|
+
"category": "Identity",
|
|
6
|
+
"pattern": "[A-Z]{5}\\d{4}[A-Z]",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["ABCDE1234F", "PXPZJ1234A"],
|
|
9
|
+
"counterExamples": ["ABCDE12345", "abcde1234f", "ABCD1234F"],
|
|
10
|
+
"locales": ["en-IN"],
|
|
11
|
+
"tags": ["pan", "india", "indian", "tax", "identity"],
|
|
12
|
+
"useCases": ["Indian tax forms", "KYC for Indian users", "Banking integrations"],
|
|
13
|
+
"seoTitle": "Indian PAN Card Regex — Validate PAN Numbers",
|
|
14
|
+
"seoDescription": "Regex for Indian PAN card number validation."
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "ipfs-cid",
|
|
3
|
+
"name": "IPFS CID",
|
|
4
|
+
"description": "Matches an IPFS Content Identifier (CIDv0 starting with Qm, or CIDv1 starting with bafy/bafk).",
|
|
5
|
+
"category": "Crypto",
|
|
6
|
+
"pattern": "(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[a-z2-7]{58,})",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": [
|
|
9
|
+
"QmZ4tDuvesekSs4qM5ZBKpXiZGun7S2CYtEZRB3DYXkjGx",
|
|
10
|
+
"bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi"
|
|
11
|
+
],
|
|
12
|
+
"counterExamples": ["not-a-cid", "Qm1234", "0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe"],
|
|
13
|
+
"tags": ["ipfs", "cid", "content-address", "decentralized", "web3", "storage"],
|
|
14
|
+
"useCases": ["IPFS gateway links", "NFT metadata validation", "Decentralized storage"],
|
|
15
|
+
"seoTitle": "IPFS CID Regex — Validate IPFS Content Identifiers",
|
|
16
|
+
"seoDescription": "Regex for IPFS CIDv0 (Qm...) and CIDv1 (bafy...) content identifier validation."
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "ipv4",
|
|
3
|
+
"name": "IPv4 Address",
|
|
4
|
+
"description": "Validates a standard IPv4 address ensuring each octet is 0–255.",
|
|
5
|
+
"category": "Network",
|
|
6
|
+
"pattern": "(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["192.168.1.1", "0.0.0.0", "255.255.255.255", "10.0.0.1"],
|
|
9
|
+
"counterExamples": ["256.1.2.3", "192.168.1", "not.an.ip", "192.168.1.1.1"],
|
|
10
|
+
"tags": ["ip", "ipv4", "networking", "server", "address"],
|
|
11
|
+
"useCases": ["Server configuration forms", "Network scanner tools", "Firewall rule builders"],
|
|
12
|
+
"seoTitle": "IPv4 Address Regex — Validate IP Addresses in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Battle-tested IPv4 regex that validates all octets are 0-255. Includes code generation for JavaScript, Go, and PHP."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "ipv6",
|
|
3
|
+
"name": "IPv6 Address",
|
|
4
|
+
"description": "Matches a full-form IPv6 address with 8 groups of 4 hexadecimal digits separated by colons.",
|
|
5
|
+
"category": "Network",
|
|
6
|
+
"pattern": "([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["2001:0db8:85a3:0000:0000:8a2e:0370:7334", "fe80:0000:0000:0000:0204:61ff:fe9d:f156"],
|
|
9
|
+
"counterExamples": ["192.168.1.1", "::1", "2001:db8::1"],
|
|
10
|
+
"tags": ["ipv6", "network", "internet", "address"],
|
|
11
|
+
"useCases": ["Network configuration validation", "Firewall rules", "API input sanitization"],
|
|
12
|
+
"seoTitle": "IPv6 Address Regex — Validate IPv6 in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for IPv6 address validation. Generate code for JavaScript, TypeScript (Zod), Go, and PHP with unit tests."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "iso-date",
|
|
3
|
+
"name": "ISO 8601 Date",
|
|
4
|
+
"description": "ISO 8601 date format (YYYY-MM-DD) with month and day range validation.",
|
|
5
|
+
"category": "Date & Time",
|
|
6
|
+
"pattern": "\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["2024-01-15", "1999-12-31", "2000-02-29"],
|
|
9
|
+
"counterExamples": ["2024-13-01", "01-01-2024", "2024/01/15", "20240115"],
|
|
10
|
+
"tags": ["date", "iso", "time", "datetime", "8601"],
|
|
11
|
+
"useCases": ["API date field validation", "Database date input parsing", "Log timestamp parsing"],
|
|
12
|
+
"seoTitle": "ISO Date Regex — Validate ISO 8601 Dates in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "ISO 8601 date regex (YYYY-MM-DD) for JavaScript, TypeScript, Go, and PHP. Includes month and day range checking."
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "it-codice-fiscale",
|
|
3
|
+
"name": "Italian Codice Fiscale",
|
|
4
|
+
"description": "Matches an Italian fiscal code (Codice Fiscale) — 16 alphanumeric characters encoding name, birth date, gender, and municipality.",
|
|
5
|
+
"category": "Identity",
|
|
6
|
+
"pattern": "[A-Z]{6}\\d{2}[A-Z]\\d{2}[A-Z]\\d{3}[A-Z]",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["RSSMRA80A01H501U", "BNCSFN85T10A944E"],
|
|
9
|
+
"counterExamples": ["RSSMRA80A01H501", "RSSMRA80A01H501UA", "123456789012345"],
|
|
10
|
+
"locales": ["it"],
|
|
11
|
+
"tags": ["codice-fiscale", "italy", "italian", "identity", "tax"],
|
|
12
|
+
"useCases": ["Italian government forms", "Healthcare system", "Tax declarations"],
|
|
13
|
+
"seoTitle": "Italian Codice Fiscale Regex — Validate Fiscal Codes",
|
|
14
|
+
"seoDescription": "Regex for Italian Codice Fiscale (fiscal code) validation."
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "jwt",
|
|
3
|
+
"name": "JWT Token",
|
|
4
|
+
"description": "Matches a JSON Web Token (JWT) — three Base64URL-encoded segments separated by dots.",
|
|
5
|
+
"category": "Security",
|
|
6
|
+
"pattern": "[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U"],
|
|
9
|
+
"counterExamples": ["not.a.jwt.with.too.many.dots", "onlytwoparts.here", "plain-string"],
|
|
10
|
+
"tags": ["jwt", "token", "auth", "security", "bearer"],
|
|
11
|
+
"useCases": ["JWT format validation", "Auth middleware", "API token parsing"],
|
|
12
|
+
"seoTitle": "JWT Token Regex — Validate JWT in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for JWT token format validation. Checks the three-part Base64URL structure."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "latitude",
|
|
3
|
+
"name": "Latitude",
|
|
4
|
+
"description": "Matches a geographic latitude coordinate between -90 and +90 degrees, with up to 6 decimal places.",
|
|
5
|
+
"category": "Geo",
|
|
6
|
+
"pattern": "-?([0-8]?\\d(\\.\\d{1,6})?|90(\\.0{1,6})?)",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["51.5074", "-33.8688", "0", "90", "-90.000000"],
|
|
9
|
+
"counterExamples": ["91.0", "-90.1", "abc", "51.5074.12"],
|
|
10
|
+
"tags": ["latitude", "geo", "coordinates", "location", "gps"],
|
|
11
|
+
"useCases": ["GPS coordinate input", "Map integrations", "Location-based services"],
|
|
12
|
+
"seoTitle": "Latitude Regex — Validate Coordinates in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for geographic latitude coordinate validation (-90 to 90)."
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "lightning-invoice",
|
|
3
|
+
"name": "Lightning Network Invoice (BOLT-11)",
|
|
4
|
+
"description": "Matches a Bitcoin Lightning Network payment invoice in BOLT-11 format — starts with lnbc, lntb, or lnbcrt.",
|
|
5
|
+
"category": "Crypto",
|
|
6
|
+
"pattern": "ln(bc|tb|bcrt)\\d*[munp]?[a-z0-9]+",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": [
|
|
9
|
+
"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaqfppnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqppnqqq",
|
|
10
|
+
"lntb100n1..."
|
|
11
|
+
],
|
|
12
|
+
"counterExamples": ["bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", "not-an-invoice", "lnxx123"],
|
|
13
|
+
"tags": ["lightning", "bitcoin", "bolt11", "invoice", "payment", "crypto"],
|
|
14
|
+
"useCases": ["Lightning payment validation", "Wallet apps", "Bitcoin point-of-sale"],
|
|
15
|
+
"seoTitle": "Lightning Invoice Regex — Validate BOLT-11 Invoices",
|
|
16
|
+
"seoDescription": "Regex for Bitcoin Lightning Network BOLT-11 invoice format validation."
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "longitude",
|
|
3
|
+
"name": "Longitude",
|
|
4
|
+
"description": "Matches a geographic longitude coordinate between -180 and +180 degrees, with up to 6 decimal places.",
|
|
5
|
+
"category": "Geo",
|
|
6
|
+
"pattern": "-?(1[0-7]\\d(\\.\\d{1,6})?|[0-9]?\\d(\\.\\d{1,6})?|180(\\.0{1,6})?)",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["-0.1278", "151.2093", "0", "180", "-180.000000"],
|
|
9
|
+
"counterExamples": ["181.0", "-180.1", "abc", "0.123456789"],
|
|
10
|
+
"tags": ["longitude", "geo", "coordinates", "location", "gps"],
|
|
11
|
+
"useCases": ["GPS coordinate input", "Map integrations", "Location-based services"],
|
|
12
|
+
"seoTitle": "Longitude Regex — Validate Coordinates in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for geographic longitude coordinate validation (-180 to 180)."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "mac-address",
|
|
3
|
+
"name": "MAC Address",
|
|
4
|
+
"description": "Matches a MAC (Media Access Control) address in both colon-separated and hyphen-separated formats.",
|
|
5
|
+
"category": "Network",
|
|
6
|
+
"pattern": "([0-9a-fA-F]{2}[:\\-]){5}[0-9a-fA-F]{2}",
|
|
7
|
+
"flags": "i",
|
|
8
|
+
"examples": ["00:1A:2B:3C:4D:5E", "00-1A-2B-3C-4D-5E", "ff:ff:ff:ff:ff:ff"],
|
|
9
|
+
"counterExamples": ["00:1A:2B:3C:4D", "GG:HH:II:JJ:KK:LL", "001A2B3C4D5E"],
|
|
10
|
+
"tags": ["mac", "network", "hardware", "address"],
|
|
11
|
+
"useCases": ["Network device identification", "Access control lists", "Device registration"],
|
|
12
|
+
"seoTitle": "MAC Address Regex — Validate MAC in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for MAC address validation supporting both colon and hyphen separators."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-blockquote",
|
|
3
|
+
"name": "Markdown Blockquote",
|
|
4
|
+
"description": "Matches a Markdown blockquote line beginning with > and captures the quoted text.",
|
|
5
|
+
"category": "Markdown",
|
|
6
|
+
"pattern": "^>+\\s?(.+)$",
|
|
7
|
+
"flags": "m",
|
|
8
|
+
"examples": ["> This is a quote", ">> Nested quote", "> Multi-word blockquote text"],
|
|
9
|
+
"counterExamples": ["Not a quote", "=> arrow", ">no space"],
|
|
10
|
+
"tags": ["markdown", "blockquote", "quote", "citation"],
|
|
11
|
+
"useCases": ["Markdown parsers", "Email reply stripping", "Forum post rendering"],
|
|
12
|
+
"seoTitle": "Markdown Blockquote Regex — Parse > Quotes in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for Markdown blockquote line detection and text extraction."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-bold",
|
|
3
|
+
"name": "Markdown Bold",
|
|
4
|
+
"description": "Matches Markdown bold text wrapped in **double asterisks** or __double underscores__.",
|
|
5
|
+
"category": "Markdown",
|
|
6
|
+
"pattern": "(\\*\\*|__)(?!\\s)(.+?)(?<!\\s)\\1",
|
|
7
|
+
"flags": "s",
|
|
8
|
+
"examples": ["**bold text**", "__also bold__", "**multi-word bold phrase**"],
|
|
9
|
+
"counterExamples": ["*single asterisk*", "** spaced **", "plain text"],
|
|
10
|
+
"tags": ["markdown", "bold", "strong", "formatting"],
|
|
11
|
+
"useCases": ["Markdown parsers", "Chat message formatting", "Rich text editors"],
|
|
12
|
+
"seoTitle": "Markdown Bold Regex — Parse **bold** Text in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for Markdown bold formatting with ** or __ delimiters."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-code-inline",
|
|
3
|
+
"name": "Markdown Inline Code",
|
|
4
|
+
"description": "Matches Markdown inline code wrapped in single `backticks` or ``double backticks``.",
|
|
5
|
+
"category": "Markdown",
|
|
6
|
+
"pattern": "(`{1,2})([^`]+)\\1",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["`code`", "``const x = 1``", "`npm install`"],
|
|
9
|
+
"counterExamples": ["```block code```", "no backticks here", "` space at start`"],
|
|
10
|
+
"tags": ["markdown", "code", "inline", "backtick", "monospace"],
|
|
11
|
+
"useCases": ["Markdown parsers", "Code extraction", "Documentation processors"],
|
|
12
|
+
"seoTitle": "Markdown Inline Code Regex — Parse `code` in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for Markdown inline code backtick extraction."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-heading",
|
|
3
|
+
"name": "Markdown Heading",
|
|
4
|
+
"description": "Matches Markdown ATX-style headings — # through ###### followed by text. Captures both the level (number of #) and the heading text.",
|
|
5
|
+
"category": "Markdown",
|
|
6
|
+
"pattern": "^(#{1,6})\\s+(.+)$",
|
|
7
|
+
"flags": "m",
|
|
8
|
+
"examples": ["# H1 Title", "## Section Two", "### Subsection", "###### Smallest Heading"],
|
|
9
|
+
"counterExamples": ["#NoSpace", "####### Too many hashes", "Not a heading"],
|
|
10
|
+
"tags": ["markdown", "heading", "h1", "h2", "title", "document"],
|
|
11
|
+
"useCases": ["Markdown parsers", "Table of contents generators", "Documentation tools"],
|
|
12
|
+
"seoTitle": "Markdown Heading Regex — Parse # Headings in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for Markdown ATX heading detection and level extraction."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-hr",
|
|
3
|
+
"name": "Markdown Horizontal Rule",
|
|
4
|
+
"description": "Matches a Markdown horizontal rule — three or more dashes, asterisks, or underscores on a line.",
|
|
5
|
+
"category": "Markdown",
|
|
6
|
+
"pattern": "^([-*_])\\s*\\1\\s*\\1[\\s\\1]*$",
|
|
7
|
+
"flags": "m",
|
|
8
|
+
"examples": ["---", "***", "___", "- - -", "* * *"],
|
|
9
|
+
"counterExamples": ["--", "**", "not a rule", "--- text"],
|
|
10
|
+
"tags": ["markdown", "horizontal-rule", "hr", "divider", "separator"],
|
|
11
|
+
"useCases": ["Markdown parsers", "Section detection", "Document structure analysis"],
|
|
12
|
+
"seoTitle": "Markdown Horizontal Rule Regex — Parse --- in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for Markdown horizontal rule (---, ***, ___) detection."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-image",
|
|
3
|
+
"name": "Markdown Image",
|
|
4
|
+
"description": "Matches a Markdown image tag  and captures both the alt text and the URL.",
|
|
5
|
+
"category": "Markdown",
|
|
6
|
+
"pattern": "!\\[([^\\]]*)\\]\\(([^)]+)\\)",
|
|
7
|
+
"flags": "g",
|
|
8
|
+
"examples": ["", "", ""],
|
|
9
|
+
"counterExamples": ["[link](url)", " in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for Markdown image syntax extraction — captures alt text and URL."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-italic",
|
|
3
|
+
"name": "Markdown Italic",
|
|
4
|
+
"description": "Matches Markdown italic text wrapped in *single asterisk* or _single underscore_.",
|
|
5
|
+
"category": "Markdown",
|
|
6
|
+
"pattern": "(\\*|_)(?!\\s)(.+?)(?<!\\s)\\1",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["*italic text*", "_also italic_", "*multi-word italic*"],
|
|
9
|
+
"counterExamples": ["**bold**", "* space before*", "plain text"],
|
|
10
|
+
"tags": ["markdown", "italic", "emphasis", "formatting"],
|
|
11
|
+
"useCases": ["Markdown parsers", "Blog editors", "Documentation processors"],
|
|
12
|
+
"seoTitle": "Markdown Italic Regex — Parse *italic* Text in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for Markdown italic formatting with * or _ delimiters."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-link",
|
|
3
|
+
"name": "Markdown Link",
|
|
4
|
+
"description": "Matches a Markdown hyperlink in [text](url) format and captures both the link text and URL.",
|
|
5
|
+
"category": "Web",
|
|
6
|
+
"pattern": "\\[([^\\]]+)\\]\\(([^)]+)\\)",
|
|
7
|
+
"flags": "g",
|
|
8
|
+
"examples": ["[regex.to](https://regex.to)", "[Click here](https://example.com)", "[Docs](/docs)"],
|
|
9
|
+
"counterExamples": ["[nourl]", "(no-brackets)https://example.com", "[](https://example.com)"],
|
|
10
|
+
"tags": ["markdown", "link", "url", "text", "parsing"],
|
|
11
|
+
"useCases": ["Markdown parsers", "Documentation tools", "Content editors"],
|
|
12
|
+
"seoTitle": "Markdown Link Regex — Parse MD Links in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for Markdown hyperlink parsing. Captures link text and URL."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-list-item",
|
|
3
|
+
"name": "Markdown List Item",
|
|
4
|
+
"description": "Matches Markdown unordered list items starting with -, *, or + and ordered items starting with a number.",
|
|
5
|
+
"category": "Markdown",
|
|
6
|
+
"pattern": "^(\\s*)([-*+]|\\d+\\.)\\s+(.+)$",
|
|
7
|
+
"flags": "m",
|
|
8
|
+
"examples": ["- item one", "* item two", "+ item three", "1. first item", " - nested item"],
|
|
9
|
+
"counterExamples": ["Not a list", "-no space", "* "],
|
|
10
|
+
"tags": ["markdown", "list", "ul", "ol", "bullet"],
|
|
11
|
+
"useCases": ["Markdown parsers", "Task list extraction", "Content processors"],
|
|
12
|
+
"seoTitle": "Markdown List Item Regex — Parse Lists in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for Markdown list item detection (unordered and ordered)."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "markdown-table-row",
|
|
3
|
+
"name": "Markdown Table Row",
|
|
4
|
+
"description": "Matches a Markdown GFM table row — cells separated by pipe | characters.",
|
|
5
|
+
"category": "Markdown",
|
|
6
|
+
"pattern": "^\\|(.+\\|)+$",
|
|
7
|
+
"flags": "m",
|
|
8
|
+
"examples": ["| Name | Age | City |", "| --- | --- | --- |", "| Alice | 30 | London |"],
|
|
9
|
+
"counterExamples": ["Not a table", "| single cell", "no pipes here"],
|
|
10
|
+
"tags": ["markdown", "table", "gfm", "pipe", "cells"],
|
|
11
|
+
"useCases": ["GFM table parsers", "Table data extraction", "Documentation tools"],
|
|
12
|
+
"seoTitle": "Markdown Table Regex — Parse GFM Tables in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for GitHub Flavored Markdown table row detection."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "md5",
|
|
3
|
+
"name": "MD5 Hash",
|
|
4
|
+
"description": "Matches an MD5 hash — exactly 32 hexadecimal characters.",
|
|
5
|
+
"category": "Security",
|
|
6
|
+
"pattern": "[a-fA-F0-9]{32}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["d41d8cd98f00b204e9800998ecf8427e", "098f6bcd4621d373cade4e832627b4f6"],
|
|
9
|
+
"counterExamples": ["d41d8cd98f00b204e9800998ecf8427", "not-an-md5", "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"],
|
|
10
|
+
"tags": ["md5", "hash", "checksum"],
|
|
11
|
+
"useCases": ["File checksums", "Legacy password verification", "Cache key generation"],
|
|
12
|
+
"seoTitle": "MD5 Hash Regex — Validate MD5 in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for MD5 hash validation — 32 hex characters."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "mention",
|
|
3
|
+
"name": "@Mention",
|
|
4
|
+
"description": "Matches a social media @mention — @ followed by 3–30 word characters.",
|
|
5
|
+
"category": "Social",
|
|
6
|
+
"pattern": "@[A-Za-z0-9_]{3,30}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["@johndoe", "@web_dev_42", "@regex_to"],
|
|
9
|
+
"counterExamples": ["@jo", "@this_is_a_very_long_handle_that_exceeds_limit", "no_at_sign"],
|
|
10
|
+
"tags": ["mention", "social", "username", "twitter", "at"],
|
|
11
|
+
"useCases": ["Social media parsing", "Notification triggers", "User tagging"],
|
|
12
|
+
"seoTitle": "@Mention Regex — Parse Mentions in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for @mention extraction from social media and chat text."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "monero-address",
|
|
3
|
+
"name": "Monero Address",
|
|
4
|
+
"description": "Matches a Monero (XMR) standard address — starts with 4 and is exactly 95 Base58 characters.",
|
|
5
|
+
"category": "Crypto",
|
|
6
|
+
"pattern": "4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A"],
|
|
9
|
+
"counterExamples": ["1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2", "0xde0B295669a9FD93d5F28D9", "short"],
|
|
10
|
+
"tags": ["monero", "xmr", "crypto", "address", "privacy", "blockchain"],
|
|
11
|
+
"useCases": ["Monero payment validation", "Privacy-focused crypto apps", "Exchange integrations"],
|
|
12
|
+
"seoTitle": "Monero Address Regex — Validate XMR Addresses",
|
|
13
|
+
"seoDescription": "Regex for Monero (XMR) wallet address validation."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "password-strong",
|
|
3
|
+
"name": "Strong Password",
|
|
4
|
+
"description": "Matches a strong password: minimum 8 characters with at least one uppercase letter, one lowercase letter, one digit, and one special character.",
|
|
5
|
+
"category": "Security",
|
|
6
|
+
"pattern": "(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&#^()\\-_+=])[A-Za-z\\d@$!%*?&#^()\\-_+=]{8,}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["P@ssw0rd", "Str0ng#Pass!", "MySecure_P4ss"],
|
|
9
|
+
"counterExamples": ["password", "PASSWORD1", "p@ssword", "Short1!"],
|
|
10
|
+
"tags": ["password", "security", "auth", "validation"],
|
|
11
|
+
"useCases": ["User registration", "Password change forms", "Security policy enforcement"],
|
|
12
|
+
"seoTitle": "Strong Password Regex — Validate Passwords in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for strong password validation: uppercase, lowercase, digit, special char, 8+ chars."
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "phone-e164",
|
|
3
|
+
"name": "Phone — E.164 International",
|
|
4
|
+
"description": "Matches an international phone number in E.164 format: + followed by country code and subscriber number (max 15 digits total).",
|
|
5
|
+
"category": "Phone",
|
|
6
|
+
"pattern": "\\+[1-9]\\d{1,14}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["+14155552671", "+442071838750", "+48123456789", "+33612345678"],
|
|
9
|
+
"counterExamples": ["+0123456789", "14155552671", "+1", "+12345678901234567"],
|
|
10
|
+
"tags": ["phone", "e164", "international", "mobile"],
|
|
11
|
+
"useCases": ["International phone validation", "SMS gateways", "Two-factor authentication"],
|
|
12
|
+
"seoTitle": "E.164 Phone Regex — International Phone Number Validation",
|
|
13
|
+
"seoDescription": "Regex for E.164 international phone number format. Works globally."
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "phone-uk",
|
|
3
|
+
"name": "Phone — UK",
|
|
4
|
+
"description": "Matches UK phone numbers in standard formats, starting with 0 or +44.",
|
|
5
|
+
"category": "Phone",
|
|
6
|
+
"pattern": "(\\+44\\s?|0)(\\d{2,4}\\s?\\d{3,4}\\s?\\d{3,4}|\\d{10})",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["+44 20 7183 8750", "020 7183 8750", "07700 900123", "07700900123"],
|
|
9
|
+
"counterExamples": ["+1 555 867 5309", "123456", "00000000000"],
|
|
10
|
+
"locales": ["en-GB"],
|
|
11
|
+
"tags": ["phone", "uk", "british", "mobile"],
|
|
12
|
+
"useCases": ["UK contact forms", "Address validation", "CRM systems"],
|
|
13
|
+
"seoTitle": "UK Phone Regex — Validate British Phone Numbers",
|
|
14
|
+
"seoDescription": "Regex for UK phone number validation. Supports landline and mobile numbers."
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "phone-us",
|
|
3
|
+
"name": "Phone — US",
|
|
4
|
+
"description": "Matches a US phone number in various formats: (555) 867-5309, 555-867-5309, 5558675309, or with +1 country code.",
|
|
5
|
+
"category": "Phone",
|
|
6
|
+
"pattern": "(\\+1[\\s\\-]?)?\\(?\\d{3}\\)?[\\s\\-]?\\d{3}[\\s\\-]?\\d{4}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["(555) 867-5309", "555-867-5309", "+1 555 867 5309", "5558675309"],
|
|
9
|
+
"counterExamples": ["+44 20 7183 8750", "123-456-789", "555-867-530"],
|
|
10
|
+
"locales": ["en-US"],
|
|
11
|
+
"tags": ["phone", "us", "american", "mobile"],
|
|
12
|
+
"useCases": ["US contact forms", "Customer registration", "Address books"],
|
|
13
|
+
"seoTitle": "US Phone Regex — Validate American Phone Numbers",
|
|
14
|
+
"seoDescription": "Regex for US phone number validation supporting multiple formats."
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "pl-nip",
|
|
3
|
+
"name": "Polish NIP (Tax ID)",
|
|
4
|
+
"description": "Polish NIP (Numer Identyfikacji Podatkowej) — the 10-digit tax identification number used by businesses and self-employed individuals in Poland.",
|
|
5
|
+
"category": "Finance",
|
|
6
|
+
"pattern": "\\d{10}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["1234563218", "5260250274", "9999999999"],
|
|
9
|
+
"counterExamples": ["123456789", "12345678901", "abcdefghij"],
|
|
10
|
+
"locales": ["pl"],
|
|
11
|
+
"tags": ["poland", "nip", "tax", "finance", "pl", "polish"],
|
|
12
|
+
"useCases": ["Polish invoice generation", "B2B payment forms", "Tax system integrations"],
|
|
13
|
+
"seoTitle": "Polish NIP Regex — Validate Polish Tax ID (NIP) Pattern",
|
|
14
|
+
"seoDescription": "Regex pattern for validating Polish NIP numbers. Generate code for JavaScript, TypeScript (Zod), Go, and PHP with unit tests."
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "pl-pesel",
|
|
3
|
+
"name": "Polish PESEL",
|
|
4
|
+
"description": "Polish national identification number (PESEL) — an 11-digit number encoding date of birth, gender, and a checksum, assigned to every citizen.",
|
|
5
|
+
"category": "Identity",
|
|
6
|
+
"pattern": "\\d{11}",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["44051401458", "02070803628", "90090515836"],
|
|
9
|
+
"counterExamples": ["1234567890", "123456789012", "abcdefghijk"],
|
|
10
|
+
"locales": ["pl"],
|
|
11
|
+
"tags": ["poland", "pesel", "identity", "pl", "polish"],
|
|
12
|
+
"useCases": ["Polish government forms", "Healthcare system integration", "KYC validation"],
|
|
13
|
+
"seoTitle": "Polish PESEL Regex — Validate PESEL Number in JS, Go, PHP",
|
|
14
|
+
"seoDescription": "Regex pattern for validating Polish PESEL numbers. Generate code for JavaScript, TypeScript (Zod), Go, and PHP with unit tests."
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "pl-regon",
|
|
3
|
+
"name": "Polish REGON",
|
|
4
|
+
"description": "Matches a Polish REGON (National Business Registry Number) — 9 digits for companies, 14 digits for local units.",
|
|
5
|
+
"category": "Identity",
|
|
6
|
+
"pattern": "(\\d{9}|\\d{14})",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["123456785", "12345678512347"],
|
|
9
|
+
"counterExamples": ["12345678", "1234567891234", "123456785A"],
|
|
10
|
+
"locales": ["pl"],
|
|
11
|
+
"tags": ["regon", "poland", "polish", "business", "company"],
|
|
12
|
+
"useCases": ["Polish company registration", "B2B invoicing", "Government APIs"],
|
|
13
|
+
"seoTitle": "Polish REGON Regex — Validate REGON Numbers",
|
|
14
|
+
"seoDescription": "Regex for Polish REGON business registry number validation."
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "port-number",
|
|
3
|
+
"name": "Port Number",
|
|
4
|
+
"description": "Matches a valid TCP/UDP port number from 0 to 65535.",
|
|
5
|
+
"category": "Network",
|
|
6
|
+
"pattern": "(6553[0-5]|655[0-2]\\d|65[0-4]\\d{2}|6[0-4]\\d{3}|[1-5]\\d{4}|[1-9]\\d{0,3}|0)",
|
|
7
|
+
"flags": "",
|
|
8
|
+
"examples": ["80", "443", "8080", "3000", "65535", "0"],
|
|
9
|
+
"counterExamples": ["65536", "99999", "-1", "abc"],
|
|
10
|
+
"tags": ["port", "network", "tcp", "udp"],
|
|
11
|
+
"useCases": ["Server configuration", "Network firewall rules", "URL parsing"],
|
|
12
|
+
"seoTitle": "Port Number Regex — Validate TCP/UDP Ports in JS, Go, PHP",
|
|
13
|
+
"seoDescription": "Regex for valid port number 0–65535. Generate code for JavaScript, Go, PHP."
|
|
14
|
+
}
|