Patterns

Title 
Associated Press Date Formatdates
2
CSS Colorscolorcsshtml
2
ISO 8601 Date Formatdates
5
Roman Numeralsnumbers
2
Zip (aka Postal) Codes in the United Statespostal codeunited statesus
2

Links

Other websites with useful regex patterns
Ultimate Guide to Validating Emails with Regex(abstractapi.com)emailpatterns
ISO 8601 Date Validation That Doesn’t Suck(myintervals.com)datespatterns
Regex for ANSI Escape Sequences(github.com/chalk)ansipatterns
check-email-valid(github.com/jonsherrard)emailpatterns
Securelog Scan detectors(github.com/Onboardbase)patternssecrets
Regular Expression Patterns(breakingpar.com)patterns
Common and Extended Log Format (archived from effbot.org)(pinboard.in)patterns
A regular expression to match all emoji-only symbols(github.com/slevithan)emojipatterns
Regular expressions cookbook by Jan Goyvaerts: Free Download, Borrow, and Streaming(archive.org)bookspatterns
Regex DB(rgxdb.com)patterns
Patterns used in iterm2's smart selections(gitlab.com/gnachman)patterns
Regular expression to match DNS hostname or IP Address?(stackoverflow.com)patterns
Regular expression to match SWIFT-BIC codes(johndcook.com)patterns
Semantic Versioning Regex(semver.org)patterns
Regular expression to match ICD-11 codes(johndcook.com)patterns
A regular expression pattern for Java/JavaScript to match all emoji in the emoji-test.txt file provided by UTS#51.(github.com/mathiasbynens)emojipatterns
A JavaScript-compatible regular expression pattern to match all RGI emoji symbols and sequences as per the Unicode Standard and UTS#51.(github.com/mathiasbynens)emojipatterns
A regular expression to match all Emoji-only symbols as per the Unicode Standard.(github.com/mathiasbynens)emojipatterns
Elliot Chance - It's Impossible to Validate an Email Address(elliot.land)emailpatterns
CommonRegex - A collection of common regular expressions(github.com/madisonmay)patternspython
Regex Pattern for URLs(daringfireball.net)patterns
A Liberal, Accurate Regex Pattern for Matching URLs(daringfireball.net)patterns
Example of Regular Expression(pinboard.in)patterns
IsValidIP - Validating an IP address(devx.com)patterns
Is Valid Internet Email Address(breakingpar.com)patterns
Raw data
[
    {
        "featured": false,
        "handle": "ap-dates",
        "title": "Associated Press Date Format",
        "tags": [
            "dates"
        ],
        "variations": [
            {
                "title": "AP Date (standalone)",
                "regex": "^(January|February|March|April|May|June|July|August|September|October|November|December) \\d{1,2}, \\d{4}$",
                "inputs": [
                    "January 1, 2020",
                    "February 29, 2020",
                    "March 15, 2020",
                    "April 30, 2020",
                    "May 1, 2020",
                    "June 15, 2020",
                    "July 31, 2020",
                    "August 1, 2020",
                    "September 15, 2020",
                    "October 31, 2020",
                    "November 1, 2020",
                    "December 15, 2020"
                ]
            },
            {
                "title": "AP Date (inline)",
                "regex": "\\b(January|February|March|April|May|June|July|August|September|October|November|December) \\d{1,2}, \\d{4}\\b",
                "inputs": [
                    "My birthday is on January 1, 2020.",
                    "I was born on February 29, 2020.",
                    "The Ides of March is on March 15, 2020.",
                    "April 30, 2020 is the last day of the month.",
                    "May 1, 2020 is the first day of the month.",
                    "June 15, 2020 is halfway through the month.",
                    "July 31, 2020 is the last day of the month.",
                    "August 1, 2020 is the first day of the month.",
                    "September 15, 2020 is halfway through the month.",
                    "October 31, 2020 is Halloween.",
                    "November 1, 2020 is the day after Halloween.",
                    "December 15, 2020 is halfway through the month."
                ]
            }
        ],
        "fullPath": "/app/patterns/ap-dates.yaml"
    },
    {
        "featured": true,
        "handle": "css-color",
        "title": "CSS Colors",
        "tags": [
            "color",
            "css",
            "html"
        ],
        "variations": [
            {
                "title": "Hex (standalone)",
                "regex": "^(#([a-fA-F0-9]{6}|[a-fA-F0-9]{3}))$",
                "inputs": [
                    "#f00",
                    "#ff0000",
                    "#0f0",
                    "#00ff00",
                    "#00f",
                    "#0000ff",
                    "#000",
                    "#000000",
                    "#fff",
                    "#ffffff"
                ]
            },
            {
                "title": "Hex (inline)",
                "regex": "\\b(#([a-fA-F0-9]{6}|[a-fA-F0-9]{3}))\\b",
                "inputs": [
                    "My favorite color is #f00!"
                ]
            }
        ],
        "fullPath": "/app/patterns/color.yaml"
    },
    {
        "featured": true,
        "handle": "iso8601-date",
        "title": "ISO 8601 Date Format",
        "tags": [
            "dates"
        ],
        "todo": "Handle millis, missing separators, etc.",
        "variations": [
            {
                "title": "ISO 8601 Complete",
                "description": "from the [Intervals Blog](https://www.myintervals.com/blog/iso-8601-date-validation/)",
                "regex": "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$",
                "inputs": [
                    "2009-12T12:34",
                    "2009",
                    "2009-05-19",
                    "2009-05-19",
                    "20090519",
                    "2009123",
                    "2009-05",
                    "2009-123",
                    "2009-222",
                    "2009-001",
                    "2009-W01-1",
                    "2009-W51-1",
                    "2009-W511",
                    "2009-W33",
                    "2009W511",
                    "2009-05-19",
                    "2009-05-19 00:00",
                    "2009-05-19 14",
                    "2009-05-19 14:31",
                    "2009-05-19 14:39:22",
                    "2009-05-19T14:39Z",
                    "2009-W21-2",
                    "2009-W21-2T01:22",
                    "2009-139",
                    "2009-05-19 14:39:22-06:00",
                    "2009-05-19 14:39:22+0600",
                    "2009-05-19 14:39:22-01",
                    "20090621T0545Z",
                    "2007-04-06T00:00",
                    "2007-04-05T24:00",
                    "2010-02-18T16:23:48.5",
                    "2010-02-18T16:23:48,444",
                    "2010-02-18T16:23:48,3-06:00",
                    "2010-02-18T16:23.4",
                    "2010-02-18T16:23,25",
                    "2010-02-18T16:23.33+0600",
                    "2010-02-18T16.23334444",
                    "2010-02-18T16,2283",
                    "2009-05-19 143922.500",
                    "2009-05-19 1439,55"
                ]
            },
            {
                "title": "ISO 8601 Date (standalone)",
                "regex": "^\\d{4}-\\d{2}-\\d{2}$",
                "inputs": [
                    "2020-01-01",
                    "2020-02-29",
                    "2020-03-15",
                    "2020-04-30",
                    "2020-05-01",
                    "2020-06-15",
                    "2020-07-31",
                    "2020-08-01",
                    "2020-09-15",
                    "2020-10-31",
                    "2020-11-01",
                    "2020-12-15"
                ]
            },
            {
                "title": "ISO 8601 Date (inline)",
                "regex": "\\b\\d{4}-\\d{2}-\\d{2}\\b",
                "inputs": [
                    "My birthday is on 2020-01-01.",
                    "I was born on 1970-01-01.",
                    "The Ides of March is on 2020-03-15.",
                    "2020-04-30 is the last day of the month.",
                    "2020-05-01 is the first day of the month.",
                    "2020-06-15 is halfway through the month.",
                    "2020-07-31 is the last day of the month.",
                    "2020-08-01 is the first day of the month.",
                    "2020-09-15 is halfway through the month.",
                    "2020-10-31 is Halloween.",
                    "2020-11-01 is the day after Halloween.",
                    "2020-12-15 is halfway through the month."
                ]
            },
            {
                "title": "ISO 8601 date+time (standalone)",
                "regex": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                "inputs": [
                    "2020-01-01T00:00:00",
                    "2020-02-29T12:34:56",
                    "2020-03-15T23:59:59",
                    "2020-04-30T01:23:45",
                    "2020-05-01T12:34:56",
                    "2020-06-15T23:59:59",
                    "2020-07-31T01:23:45",
                    "2020-08-01T12:34:56",
                    "2020-09-15T23:59:59",
                    "2020-10-31T01:23:45",
                    "2020-11-01T12:34:56",
                    "2020-12-15T23:59:59"
                ]
            },
            {
                "title": "ISO 8601 simple date+time (inline)",
                "regex": "\\b\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\b",
                "inputs": [
                    "My birthday is on 2020-01-01T00:00:00.",
                    "I was born on 1970-01-01T00:00:00.",
                    "The Ides of March is on 2020-03-15T23:59:59.",
                    "2020-04-30T01:23:45 is the last day of the month.",
                    "2020-05-01T12:34:56 is the first day of the month.",
                    "2020-06-15T23:59:59 is halfway through the month.",
                    "2020-07-31T01:23:45 is the last day of the month.",
                    "2020-08-01T12:34:56 is the first day of the month.",
                    "2020-09-15T23:59:59 is halfway through the month.",
                    "2020-10-31T01:23:45 is Halloween.",
                    "2020-11-01T12:34:56 is the day after Halloween.",
                    "2020-12-15T23:59:59 is halfway through the month."
                ]
            }
        ],
        "fullPath": "/app/patterns/iso8601-date.yaml"
    },
    {
        "featured": true,
        "handle": "roman-numeral",
        "tags": [
            "numbers"
        ],
        "title": "Roman Numerals",
        "inputs": [
            "I",
            "i",
            "V",
            "v",
            "VI",
            "IV",
            "IX",
            "X",
            "XI",
            "XIV",
            "XIX",
            "XX"
        ],
        "variations": [
            {
                "title": "Roman Numerals (standalone)",
                "regex": "^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$",
                "inputs": [
                    "I",
                    "i",
                    "V",
                    "v",
                    "VI",
                    "IV",
                    "IX",
                    "X",
                    "XI",
                    "XIV",
                    "XIX",
                    "XX"
                ]
            },
            {
                "title": "Roman Numerals (inline)",
                "regex": "\\bM{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})\\b",
                "inputs": [
                    "I",
                    "i",
                    "V",
                    "v",
                    "VI",
                    "IV",
                    "IX",
                    "X",
                    "XI",
                    "XIV",
                    "XIX",
                    "XX"
                ]
            }
        ],
        "fullPath": "/app/patterns/roman-numeral.yaml"
    },
    {
        "detail": "Postal codes (aka ZIP codes) in the United States consist of 5 digits with an optional 4 digit suffix.\n\n[Wikipedia](https://en.wikipedia.org/wiki/ZIP_Code)\n",
        "featured": true,
        "handle": "zip-code",
        "title": "Zip (aka Postal) Codes in the United States",
        "tags": [
            "postal-code",
            "united-states",
            "us"
        ],
        "variations": [
            {
                "title": "US Zip Code (standalone)",
                "regex": "^((\\d{5})(-\\d{4})?)$",
                "replacement": "zip code is \"\\1\"",
                "inputs": [
                    "12345",
                    "12345-6789"
                ]
            },
            {
                "title": "US Zip Code (inline)",
                "regex": "\\b((\\d{5})(-\\d{4})?)\\b"
            }
        ],
        "fullPath": "/app/patterns/zip-code.yaml"
    }
]