expression
stringlengths 4
1.37k
| raw_prompt
stringlengths 11
1.08k
| refined_prompt
stringlengths 79
906
| matches
sequence | non_matches
sequence | id
int64 1
4.11k
|
---|---|---|---|---|---|
^\d$ | Matches exactly 1 numeric digit (0-9). | Matches exactly 1 numeric digit (0-9).
Match examples:
- "1"
- "2"
- "3"
Non-match examples:
- "a"
- "324" | [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"0"
] | [
"a",
"324",
"num",
"location = 3",
"ssda",
"11",
"hello world",
"something something",
"asd",
"123fsf",
"the car",
"lorem ipsum"
] | 1 |
^\d{5}$ | Matches 5 numeric digits, such as a zip code. | Matches 5 numeric digits, such as a zip code.
Match examples:
- "33333"
- "55555"
- "23445"
Non-match examples:
- "abcd"
- "1324" | [
"33333",
"55555",
"23445",
"89343",
"46556",
"25432",
"25336",
"43576",
"68797",
"30495",
"54348",
"45935",
"93857"
] | [
"abcd",
"1324",
"as;lkjdf",
"jaldks",
"234",
"8hr4f",
"fsdg",
"2546dgwre",
"8j989",
"xhsn",
"potrewjdsg",
"h345gf43"
] | 2 |
^\d{5}-\d{4}$ | Numeric and hyphen 5+4 ZIP code match for ZIP+4. | Matches a string that starts with five digits, followed by a hyphen, and ends with four digits.
Match examples:
- "22222-3333"
- "34545-2367"
- "56334-2343"
Non-match examples:
- "123456789"
- "A3B 4C5" | [
"22222-3333",
"34545-2367",
"56334-2343",
"34539-5433",
"12349-5943",
"54329-9875",
"34852-5493",
"83542-2314",
"52435-3489",
"12345-0983",
"98745-2385",
"48294-2945"
] | [
"123456789",
"A3B 4C5",
"55335",
"dinfa",
"sfalijad234",
"asdf3453",
"dsjlka3",
"234fsd",
"gaqwer3",
"adfa2",
"23457-4332w2"
] | 3 |
^\d{5}$|^\d{5}-\d{4}$ | This regular expression will match either a 5 digit ZIP code or a ZIP+4 code formatted as 5 digits, a hyphen, and another 4 digits. Other than that, this is just a really really long description of a regular expression that I'm using to test how my front page will look in the case where very long expression descriptions are used. | Match either a 5 digit ZIP code or a ZIP+4 code formatted as a string that starts with five digits, followed by a hyphen, and ends with four digits..
Match examples:
- "55555-5555"
- "34564-3342"
- "90210"
Non-match examples:
- "434454444"
- "645-32-2345" | [
"55555-5555",
"34564-3342",
"90210",
"03945",
"02946",
"46556",
"52346",
"34534-3252",
"49672-3923",
"59403-6934",
"35349-6753",
"52346-3953"
] | [
"434454444",
"645-32-2345",
"abc",
"394-3498",
"234565423",
"j3942fw",
"43-5432",
"5324523-345",
"h909f34f",
"0953jg",
"wtre-0n",
"3409fjg43"
] | 4 |
^\d{3}-\d{2}-\d{4}$ | This regular expression will match a hyphen-separated Social Security Number (SSN) in the format NNN-NN-NNNN. | This regular expression will match a hyphen-separated Social Security Number (SSN) in the format NNN-NN-NNNN.
Match examples:
- "333-22-4444"
- "123-45-6789"
- "534-74-2573"
Non-match examples:
- "123456789"
- "SSN" | [
"333-22-4444",
"123-45-6789",
"534-74-2573",
"234-45-6235",
"968-24-4395",
"948-53-5924",
"493-42-5938",
"954-97-5942",
"534-96-3623",
"549-69-3456",
"543-54-6396",
"294-68-1957"
] | [
"123456789",
"SSN",
"-243",
"4523-24352-453",
"2346-2345-2435",
"dgsfjkl",
"2204fj",
"234jgs-345",
"4235-fgdsg",
"afd-asdf",
"dfg",
"32542"
] | 5 |
^[a-zA-Z]$ | Matches any single upper- or lower-case letter. | Matches any single upper- or lower-case letter.
Match examples:
- "a"
- "B"
- "c"
Non-match examples:
- "0"
- "&" | [
"a",
"B",
"c",
"f",
"J",
"D",
"s",
"D",
"d",
"o",
"F",
"p",
"r"
] | [
"0",
"&",
"AbC",
"rewv342",
"vr",
"@",
"sdfSDF",
"asf",
"324df",
"34fs2",
"34d2vdw",
"99999@gmail"
] | 6 |
^[a-zA-Z]+$ | Matches any string of only upper- and lower- case letters (no spaces). | Matches any string of only upper- and lower- case letters (no spaces).
Match examples:
- "abc"
- "ABC"
- "aBcDeF"
Non-match examples:
- "abc123"
- "mr." | [
"abc",
"ABC",
"aBcDeF",
"dfasdfs",
"ALKFJsf",
"FDSfdsf",
"AJFDAL",
"sfdjk",
"FISD",
"sadfkjl",
"fadghui",
"FDSnfsdFDS",
"sdfjoi"
] | [
"abc123",
"mr.",
"a word",
"a a a",
"209fsd",
"3nf@",
"fgsda23",
"nu9",
"u09nKLJG FSL",
"gdfios jsfoi",
"JFLSKJ FSDOIJ",
"GOOD friend"
] | 7 |
^[a-zA-Z0-9]+$ | Matches any alphanumeric string (no spaces). | Matches any alphanumeric string (a string that contains only English letters and/or digits without spaces).
Match examples:
- "10a"
- "ABC"
- "A3fg"
Non-match examples:
- "45.3"
- "this or that" | [
"10a",
"ABC",
"A3fg",
"AFDSA",
"asfsafd",
"123",
"123123abcAfds",
"2398djAD",
"dsfhoi329",
"98hsd",
"NOTREDAME",
"ILOVEND",
"notredame46556"
] | [
"45.3",
"this or that",
"$23",
"...111",
"2346-2345-2435",
"3nf@",
"43-5432",
"2546dgwre fsdfsd",
"u09nKLJG FSL",
"90ndfdfs ,./././ dcf",
"sdf324 abc...",
"99999@gmail"
] | 8 |
^\d+$ | Positive integer value. | Positive integer value.
Match examples:
- "123"
- "10"
- "54"
Non-match examples:
- "-54"
- "54.234" | [
"123",
"10",
"54",
"39",
"583",
"395",
"2394",
"2394854",
"384",
"324",
"222",
"1",
"2",
"39",
"583",
"395",
"2394",
"2394854",
"384",
"324",
"222",
"1",
"2"
] | [
"-54",
"54.234",
"abc",
"-123",
"9ijn",
"qwer",
"-312",
"1.1",
"1.1.1",
"1-1-2",
"34.31",
"8h98009hu",
"-123",
"9ijn",
"qwer",
"-312",
"1.1",
"1.1.1",
"1-1-2",
"34.31",
"8h98009hu"
] | 9 |
^(\+|-)?\d+$ | Matches any signed integer. | Matches any signed integer, in other words, a string that can start with an optional plus (+) or minus (-) sign, followed by one or more digits.
Match examples:
- "-34"
- "34"
- "+5"
Non-match examples:
- "abc"
- "3.1415" | [
"-34",
"34",
"+5",
"809",
"790987",
"+5483920",
"-2354",
"+540893",
"-234",
"2349",
"5094",
"234234",
"+123"
] | [
"abc",
"3.1415",
"-5.3",
"0bu9",
"234dc",
"312ccc",
"123u98b",
"1.2",
"-2.3",
"4.5",
"+4.5",
"-99.99"
] | 10 |
^[a-zA-Z]\w{3,14}$ | The password's first character must be a letter, it must contain at least 4 characters and no more than 15 characters and no characters other than letters, numbers and the underscore may be used | The password's first character must be a letter, it must contain at least 4 characters and no more than 15 characters and no characters other than letters, numbers and the underscore may be used.
Match examples:
- "abcd"
- "aBc45DSD_sdf"
- "password"
Non-match examples:
- "afv"
- "1234" | [
"abcd",
"aBc45DSD_sdf",
"password",
"F3fsdsdf_234",
"F0392",
"fd02934",
"k2039",
"ABC09314",
"abc_ABC",
"NOTREDAME",
"fadghui",
"QWERTY",
"p0p0p0"
] | [
"afv",
"1234",
"reallylongpassword",
"1",
"234",
"ab",
"123312312",
"98iojk",
"9ijk",
"98hsdf",
"longlonglonglonglong",
"hello12345hello12345"
] | 11 |
^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$ | Simple email expression. Doesn't allow numbers in the domain name and doesn't allow for top level domains that are less than 2 or more than 3 letters (which is fine until they allow more). Doesn't handle multiple "." in the domain (joe@abc.co.uk). | Checks if an email address starts with one or more alphanumeric characters, followed by the "@" symbol, a domain name with letters or underscores, a dot, and finally a domain extension with two or three letters.
Match examples:
- "joe@aol.com"
- "ssmith@aspalliance.com"
- "a@b.cc"
Non-match examples:
- "joe@123aspx.com"
- "joe@web.info" | [
"joe@aol.com",
"ssmith@aspalliance.com",
"a@b.cc",
"apple@qq.com",
"123@qq.com",
"abc@abc.com",
"ab@ab.ab",
"bc@bc.bc",
"avpl@qq.cn",
"sustech@nd.com",
"msft@nd.us",
"notredame@nd.edu"
] | [
"joe@123aspx.com",
"joe@web.info",
"joe@company.co.uk",
"234dsf@032ijsd.fasdf.sdf",
"fads@sdaf@asdf",
"89ioj@9ijosf",
"abc@abc",
"a@a.a.a",
"qwerty@123.123",
"123@sustech.edu.cn",
"apple@banana",
"test@test.test"
] | 12 |
^\d{1,2}\/\d{1,2}\/\d{4}$ | This regular expressions matches dates of the form XX/XX/YYYY where XX can be 1 or 2 digits long and YYYY is always 4 digits long. | This regular expressions matches dates of the form XX/XX/YYYY where XX can be 1 or 2 digits long and YYYY is always 4 digits long.
Match examples:
- "4/1/2001"
- "12/12/2001"
- "55/5/3434"
Non-match examples:
- "1/1/01"
- "12 Jan 01" | [
"4/1/2001",
"12/12/2001",
"55/5/3434",
"1/1/1111",
"2/2/2222",
"23/3/3333",
"11/11/1111",
"1/1/1111",
"30/30/3030",
"55/5/5555",
"5/55/5678",
"12/12/1221",
"55/44/4321"
] | [
"1/1/01",
"12 Jan 01",
"1-1-2001",
"1/1/1",
"2/2/22",
"3/3/333",
"5/5/55555",
"44/444/4",
"Oct 7 2002",
"1007",
"qwerty",
"2020/2/2"
] | 13 |
^[1-5]$ | This matches a single numeric digit between 1 and 5, and is the same as saying ^[12345]$. | Matches a single digit between 1 and 5, inclusive. It will only match a single character that is exactly one of the digits 1, 2, 3, 4, or 5, and is the same as saying ^[12345]$.
Match examples:
- "1"
- "3"
- "4"
Non-match examples:
- "6"
- "23" | [
"1",
"3",
"4",
"2",
"5"
] | [
"6",
"23",
"a",
"12",
"243",
"562",
"f324",
"fvd",
"-2",
"7",
"-1",
"000"
] | 15 |
^[12345]$ | This matches a single numeric digit between 1 and 5, and is the same as saying ^[1-5]$. | This matches a single numeric digit between 1 and 5, and is the same as saying ^[1-5]$.
Match examples:
- "1"
- "2"
- "4"
Non-match examples:
- "6"
- "-1" | [
"1",
"2",
"4",
"3",
"5"
] | [
"6",
"-1",
"abc",
"-123",
"234",
"3nf@",
"-312",
"2546dgwre",
"u09nKLJG FSL",
"1-1-2",
"dfg",
"32542"
] | 16 |
^[2-9]\d{2}-\d{3}-\d{4}$ | This expression matches a hyphen separated US phone number, of the form ANN-NNN-NNNN, where A is between 2 and 9 and N is between 0 and 9. | This expression matches a hyphen separated US phone number, of the form ANN-NNN-NNNN, where A is between 2 and 9 and N is between 0 and 9.
Match examples:
- "800-555-5555"
- "333-444-5555"
- "212-666-1234"
Non-match examples:
- "000-000-0000"
- "123-456-7890" | [
"800-555-5555",
"333-444-5555",
"212-666-1234",
"444-555-6666",
"300-000-0000",
"444-444-4444",
"678-678-6789",
"987-987-9876",
"543-543-5678",
"794-564-7456",
"368-654-7568",
"987-978-4732",
"655-878-3664"
] | [
"000-000-0000",
"123-456-7890",
"2126661234",
"549-234-253",
"235235234",
"9h09dh9",
"000-000-0000",
"111-111-1111",
"u09nKLJG FSL",
"adfa2",
"222-222-22222",
"123-456-7890"
] | 18 |
^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$ | Domain names:
This regular expression tests the validity of a domain or hostname. It will match any valid domain name that does not contain characters which are invalid in URLs, and which ends in .com, .org, .net, .mil, or .edu. You can add additional valid TLDs by appending the | (pipe) character and the desired TLD to the list in the parens. | Match strings that start with one or more alphanumeric characters, hyphens, or dots, followed by a dot, and end with either "com", "org", "net", "mil", or "edu" (case insensitive). This is typically used to validate domain names.
Match examples:
- "3SquareBand.com"
- "asp.net"
- "army.mil"
Non-match examples:
- "$SquareBand.com"
- "asp/dot.net" | [
"3SquareBand.com",
"asp.net",
"army.mil",
"baidu.com",
"google.com",
"sustech.edu",
"milion.mil",
"brooklyn.net",
"apple.com",
"nd.edu",
"abc.net",
"zzz.edu",
"notredame.com"
] | [
"$SquareBand.com",
"asp/dot.net",
"army.military",
"adsfsafs.com.qer",
"9injd23.net.abc",
"a/b/c.com",
"nd.education",
"nd.computer",
"github.abc",
"com.edu.github",
"@#$.com",
"abcabc.abc"
] | 20 |
^(?=.*\d).{4,8}$ | Password expression. Password must be between 4 and 8 digits long and include at least one numeric digit. | Password expression. Password must be between 4 and 8 digits long and include at least one numeric digit.
Match examples:
- "1234"
- "asdf1234"
- "asp123"
Non-match examples:
- "asdf"
- "asdf12345" | [
"1234",
"asdf1234",
"asp123",
"09jio",
"dfahui09",
"ifjd9",
"dsuui6",
"34jio23",
"1234567",
"9jid33",
"09jc",
"nonum00",
"a1b2c3"
] | [
"asdf",
"asdf12345",
"password",
"oijsdfa000",
"90jio09iomk",
"123",
"999",
"4digitlong",
"helloworld",
"number",
"abc111def",
"8a8"
] | 25 |
^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$ | Password matching expression. Password must be at least 4 characters, no more than 8 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit. | Password matching expression. Password must be at least 4 characters, no more than 8 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit.
Match examples:
- "asD1"
- "asDF1234"
- "ASPgo123"
Non-match examples:
- "asdf"
- "1234" | [
"asD1",
"asDF1234",
"ASPgo123",
"Aa1Bb2",
"sdafAF1",
"FDS3fs",
"111AAAa",
"pokdfsA9",
"FODISd8",
"823FDSd",
"j09FFF",
"jso00QQ",
"SD0dsff"
] | [
"asdf",
"1234",
"ASDF12345",
"oinjoFW",
"FWOEjinfw908",
"lkkl0908",
"AAAAAAA",
"adfjsfk",
"88888888",
"Aa1",
"BbBbBbBb2222",
"0j0jweBBBB"
] | 26 |
^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$ | RegExp for validating the format of IP Addresses. This works great with the ASP.NET RegularExpressionValidator server control. | Ensures that the string matches a valid IP address format, where each part of the address falls within the range of 0 to 255.
Match examples:
- "127.0.0.1"
- "255.255.255.0"
- "192.168.0.1"
Non-match examples:
- "1200.5.4.3"
- "abc.def.ghi.jkl" | [
"127.0.0.1",
"255.255.255.0",
"192.168.0.1",
"234.234.234.234",
"1.1.1.1",
"195.35.98.3",
"5.5.5.5",
"88.88.88.88",
"38.68.64.123",
"199.198.197.196",
"123.124.125.126",
"135.146.157.168",
"53.24.34.67"
] | [
"1200.5.4.3",
"abc.def.ghi.jkl",
"255.foo.bar.1",
"nd.nd.nd.nd",
"123.456.789",
"987.988.989",
"carry",
"12f3.21f3.213f",
"9.9.9.9.9",
"654.654.654",
"g3.g543.g45",
"0988.74534.5464"
] | 27 |
^[\w\.=-]+@[\w\.-]+\.[\w]{2,3}$ | Much simpler email expression. This one forces a length of 2 or 3, which fits current specs, but you may need to alter the end as this one allows all numerals on the .COM section. | Starts with one or more word characters, dots, equal signs, or hyphens.
Followed by an @ symbol.
Followed by one or more word characters, dots, hyphens, or dots.
Followed by a dot (.)
Ends with two or three word characters.
Match examples:
- "a@a.com"
- "a@a.com.au"
- "a@a.au"
Non-match examples:
- "word"
- "word@" | [
"a@a.com",
"a@a.com.au",
"a@a.au",
"abc@abc.abc",
"baidu@qq.com",
"qq@qq.com",
"abc@ab.cn",
"hi@nd.edu",
"nd@edu.us",
"us@nd.edu",
"cse@nd.edu",
"hello@hi.us",
"abc@msft.org"
] | [
"word",
"word@",
"@word",
"iasdjf@",
"@09jafsd",
"sdaf.FSD",
"@@fsdfa.fsad",
"09jfs@osifdj@sdf",
"dsfl",
"092j3d",
"sda sad",
"@sdaf@sdf123"
] | 34 |
^\$[0-9]+(\.[0-9][0-9])?$ | Validates a dollar amount including a dollar sign and 2 decmals. The decimal and cents are optional. | Matches strings that start with a dollar sign, followed by one or more digits, and optionally followed by a dot and exactly two more digits representing the decimal part.
Match examples:
- "$1.50"
- "$49"
- "$0.50"
Non-match examples:
- "1.5"
- "$1.333" | [
"$1.50",
"$49",
"$0.50",
"$1",
"$10",
"$99.99",
"$1.12",
"$5.55",
"$66.66",
"$100",
"$88",
"$68",
"$50.50"
] | [
"1.5",
"$1.333",
"this $5.12 fails",
"$4.2",
"234.634",
"$23.454",
"$3.2",
"66.66",
"#32.34",
"$.23",
"$345.605",
"¥423.34"
] | 36 |
^([\w\d\-\.]+)@{1}(([\w\d\-]{1,67})|([\w\d\-]+\.[\w\d\-]{1,67}))\.(([a-zA-Z\d]{2,4})(\.[a-zA-Z\d]{2})?)$ | This pattern allows standard e-mail addresses (e.g. user@domain.com), sub domains (e.g. user@foo.domain.com), the new two- and four-letter domains (e.g. user@domain.tv and user@domain.name) and country codes (e.g. user@foo.com.us). Also, this patter follows the Network Solutions standard length of 67 characters for top-level domains. The reason I allow numbers to be entered in the domain suffix is for future planning. If you do not want numbers to be able to be added as a domain suffix (e.g. user@domain.123), simply delete the last two occurrences of "\d". | This pattern allows standard e-mail addresses (e.g. user@domain.com), sub domains (e.g. user@foo.domain.com), the new two- and four-letter domains (e.g. user@domain.tv and user@domain.name) and country codes (e.g. user@foo.com.us). Also, this patter follows the Network Solutions standard length of 67 characters for top-level domains.
Match examples:
- "foo@foo.com"
- "foo@foo-foo.com.au"
- "foo@foo.foo.info"
Non-match examples:
- "foo@.com"
- "foo@foo..com" | [
"foo@foo.com",
"foo@foo-foo.com.au",
"foo@foo.foo.info",
"abc@abc.com",
"fds@gad-agd.com.us",
"bds@bfv.foo.info",
"def@def.com",
"foo@org-foo.org.au",
"bop@foo.qre.info",
"asd@fsa.com",
"gad@afd.ghe.au",
"hcs@bfq.foo.info",
"gas@dfs-erw.org.au"
] | [
"foo@.com",
"foo@foo..com",
"foo@me@.com",
"fasd@fds.fasd@",
"fa0efj3@fs.FSDFr32@",
"vsdfaslk..adsaf",
"cfa@oifsd",
"@R#@@#RDS",
"fdssdf@FSD.fweoijF@",
"fdsa.@FDS.@FD",
"fdsf@@@fsdf",
"gsfdoji@FDS"
] | 41 |
^[0-9]+$ | Validate a string to see if it contains a number / integer | Matches strings that consist entirely of one or more digits (0-9).
Match examples:
- "1234567890"
- "4123109"
- "53421"
Non-match examples:
- "f423"
- "f34fvfv" | [
"1234567890",
"4123109",
"53421",
"512345",
"123451",
"5123543",
"12356",
"9",
"65409",
"34905",
"5436",
"65409",
"245309"
] | [
"f423",
"f34fvfv",
"34f2vf42e",
"234.f23v425",
"f2v3r",
"f23r2",
"2fre2",
"vfre2fvre",
"fer222r3",
"erfv2",
"2fe2vf",
"2efr245"
] | 42 |
^.{4,8}$ | Matches any string between 4 and 8 characters in length. Limits the length of a string. Useful to add to password regular expressions. | Matches any string between 4 and 8 characters in length. Limits the length of a string.
Match examples:
- "asdf"
- "1234"
- "asdf1234"
Non-match examples:
- "asd"
- "123" | [
"asdf",
"1234",
"asdf1234",
"adsji",
"gj0q3",
"f234f24",
"2f43f",
"432g2g",
"g324",
"g342g432",
"g43g23y",
"u7jj74",
"j746t"
] | [
"asd",
"123",
"asdfe12345",
"09u4ff2n3094",
"23t4v90m2",
"34",
"2",
"v",
"2b3t2tb43",
"t24b32tv43",
"nu5624t3v",
"j2v"
] | 45 |
^\d*$ | Accepts an unsigned integer number. Also matches empty strings. | Accepts an unsigned integer number. Also matches empty strings.
Match examples:
- "123"
- "000"
- "43"
Non-match examples:
- "asbc"
- "-34" | [
"123",
"000",
"43",
"435",
"513",
"651",
"3416",
"16",
"6143",
"643",
"76",
"876",
"34"
] | [
"asbc",
"-34",
"3.1415",
"f443",
"2f43",
"3.3",
"-1",
"25v3",
"3425-13",
"4352-5243254.",
"gwerb",
"32vt"
] | 46 |
^[-+]?\d*$ | Matches any integer number or numeric string, including positive and negative value characters (+ or -). Also matches empty strings. | Matches any integer number or numeric string, including positive and negative value characters (+ or -). Also matches empty strings.
Match examples:
- "123"
- "-123"
- "+123"
Non-match examples:
- "abc"
- "3.14159" | [
"123",
"-123",
"+123",
"34091511",
"+54",
"-12314",
"5134514",
"-5243",
"+4145",
"35134",
"-543",
"+65",
"5134513"
] | [
"abc",
"3.14159",
"-3.14159",
"543.435",
"432v",
"43.v234",
"1-1-1",
"2v345234v",
"22-423",
"435.vwre-34",
"44-6234",
"+24-234.345"
] | 47 |
^\d*\.?\d*$ | Matches any unsigned floating point number/numeric string. Also matches empty strings. | Matches any unsigned floating point number/numeric string. Also matches empty strings.
Match examples:
- "123"
- "3.14159"
- ".234"
Non-match examples:
- "abc"
- "-3.14159" | [
"123",
"3.14159",
".234",
"354.5342",
"654.435",
"6254.2345",
"543",
"2345",
"3465",
"7542",
"6254.4526",
"742",
"7225464526"
] | [
"abc",
"-3.14159",
"3.4.2",
"b5242g",
"f45.2g",
"b254yb54.254yb",
"2y45.y245",
"254627g.256",
"-2.22",
"3g54",
"-652.63264",
"3yb43yb5"
] | 48 |
^([0-9]( |-)?)?(\(?[0-9]{3}\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$ | Matches US phone number format. 1 in the beginning is optional, area code is required, spaces or dashes can be used as optional divider between number groups. Also alphanumeric format is allowed after area code. | Matches US phone number format. 1 in the beginning is optional, area code is required, spaces or dashes can be used as optional divider between number groups. Also alphanumeric format is allowed after area code.
Match examples:
- "1-(123)-123-1234"
- "123 123 1234"
- "1-800-ALPHNUM"
Non-match examples:
- "1.123.123.1234"
- "(123)-1234-123" | [
"1-(123)-123-1234",
"123 123 1234",
"1-800-ALPHNUM",
"258 426 6254",
"1-(531)-123-5435",
"258 426 5131",
"1-(123)-754-7517",
"1-846-ALPHNUM",
"653 426 5431",
"1-(866)-123-8648",
"1-653-ALPHNUM",
"534 643 6254",
"258 426 7635"
] | [
"1.123.123.1234",
"(123)-1234-123",
"123-1234",
"546",
"1324.1541",
"f234f23",
"56",
"4562452642562456",
"541543.415",
"4325265426624",
"654",
"4351.1345"
] | 53 |
^([0-1][0-9]|[2][0-3]):([0-5][0-9])$ | Matches a string if it is a valid time in the format of HH:MM | Matches a string if it is a valid time in the format of HH:MM
Match examples:
- "02:04"
- "16:56"
- "23:59"
Non-match examples:
- "02:00 PM"
- "PM2:00" | [
"02:04",
"16:56",
"23:59",
"15:42",
"15:34",
"16:43",
"06:54",
"05:25",
"05:23",
"07:52",
"06:24",
"03:53",
"03:27"
] | [
"02:00 PM",
"PM2:00",
"24:00",
"71:543t4",
"51:534",
"75:62",
"86:75",
"48:345",
"57:73",
"2am",
"4pm",
"253@#RFE"
] | 54 |
^\s*[a-zA-Z,\s]+\s*$ | Any Expression Upper/Lower Case, with commas and space between the text, with any amount of space before or after | Match strings that consist of alphabetic characters (both lowercase and uppercase) and commas, allowing for leading and trailing whitespace.
Match examples:
- "Smith, Ed"
- "Ed Smith"
- "aBcDeFgH"
Non-match examples:
- "a123"
- "AB5" | [
"Smith, Ed",
"Ed Smith",
"aBcDeFgH",
"Michael afds",
"fnsdkajf",
"Hello world",
"asdfafds adsf",
"afdsffda asddas",
"fads, asdf",
"sda, fasf",
"EFDSF, FSD",
"fasdf, FDS",
"FDSfdso JDSF"
] | [
"a123",
"AB5",
"Mr. Ed",
"vqvq.ecqw",
"cqrewcr/qtv",
"fqsdv$vw",
"@#dfkjnav",
"2546dgwre",
"u09nKLJG FSL",
"1-1-2",
"34.31",
"32542"
] | 57 |
^\d{5}(-\d{4})?$ | Matches standard 5 digit US Zip Codes, or the US ZIP + 4 Standard. | Matches standard 5 digit US Zip Codes, or the US ZIP + 4 Standard.
Match examples:
- "48222"
- "48222-1746"
- "51314"
Non-match examples:
- "4632"
- "Blake" | [
"48222",
"48222-1746",
"51314",
"61341",
"64316",
"43534",
"46556",
"54315-1634",
"64316-1643",
"74567-2456",
"26543-2664",
"27563",
"57422"
] | [
"4632",
"Blake",
"37333-32",
"4235",
"543161435",
"1543543",
"15436131",
"1534513",
"4351-345151",
"13451534-514351",
"3415-34564",
"3461-436643"
] | 68 |
(^\+[0-9]{2}|^\+[0-9]{2}\(0\)|^\(\+[0-9]{2}\)\(0\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\-\s]{10}$) | Regular expression to evaluate dutch-style phone numbers. Possible example prefixes: +31, +31(0), (+31)(0), 0, 0031
followed by 9 numbers (which can contain a space or -). | Match strings representing Dutch-style phone numbers. It allows for an optional country code, with various formats accepted. Possible example prefixes: +31, +31(0), (+31)(0), 0, 0031
followed by 9 numbers (which can contain a space or -). The main content of the phone number can consist of nine or ten digits, with optional hyphens or spaces in the ten-digit format.
Match examples:
- "+31235256677"
- "+31(0)235256677"
- "023-5256677"
Non-match examples:
- "+3123525667788999"
- "3123525667788" | [
"+31235256677",
"+31(0)235256677",
"023-5256677",
"+31235248394",
"+31235256839",
"+31(0)235256839",
"+31(0)267395867",
"+31(0)235259495",
"+31(0)573956677",
"023-5255729",
"023-5268277",
"023-5583757",
"023-5839583"
] | [
"+3123525667788999",
"3123525667788",
"232-2566778",
"09827509480193284014",
"9845092820459524-2435234",
"2435-435",
"2345-652",
"23fu490n",
"243.2543",
"+354+534",
"5334.435",
"++63453.345"
] | 69 |
^\d{9}[\d|X]$ | A very simple ISBN validation expression - it just checks for a 10 digit number where the last digit could also be a capital 'X'. Complete specs for ISBN available here:
http://www.isbn.org/standards/home/isbn/international/html/usm4.htm. An enhancement would be to allow exactly 3 or 0 hyphens or 3 or 0 spaces, since these are also valid formats. | Checks for a 10 digit number where the last digit could also be a capital 'X'.
Match examples:
- "1234123412"
- "123412341X"
- "4738195735"
Non-match examples:
- "not an isbn"
- "54390853" | [
"1234123412",
"123412341X",
"4738195735",
"4582943285",
"5284574935",
"5243524396",
"5930285928",
"5534098534",
"620598320X",
"534809534X",
"123141414X",
"432423432X",
"502498905X"
] | [
"not an isbn",
"54390853",
"53495083409x",
"452093xx",
"534985309XX",
"24309X",
"098423098029840293",
"4029384230980980X",
"9vu82i3nuif",
"423890jidofs",
"2398ufsd",
"893420980)U(X"
] | 73 |
^(([1-9])|(0[1-9])|(1[0-2]))\/(([0-9])|([0-2][0-9])|(3[0-1]))\/(([0-9][0-9])|([1-2][0,9][0-9][0-9]))$ | Dates
day: d or dd, <= 31,
month: m or mm, <= 12,
year: yy or yyyy >= 1900, <= 2099 | The regular expression represents a date format where the day, month, and year are separated by forward slashes (/), and the allowed ranges for each component are:
day (d or dd): from 1 to 31
month (m or mm): from 1 to 12
year (yy or yyyy): from 1900 to 2099
Match examples:
- "01/01/2001"
- "1/1/1999"
- "10/20/2080"
Non-match examples:
- "13/01/2001"
- "1/1/1800" | [
"01/01/2001",
"1/1/1999",
"10/20/2080",
"1/1/2000",
"2/2/2022",
"10/10/2020",
"12/12/2012",
"7/30/2020",
"4/29/2008",
"4/5/2034",
"7/04/2043",
"05/5/2005",
"6/06/2006",
"1/1/2000",
"2/2/2022",
"10/10/2020",
"12/12/2012",
"7/30/2020",
"4/29/2008",
"4/5/2034",
"7/04/2043",
"05/5/2005",
"6/06/2006",
"1/1/2000",
"2/2/2022",
"10/10/2020",
"12/12/2012",
"7/30/2020",
"4/29/2008",
"4/5/2034",
"7/04/2043",
"05/5/2005",
"6/06/2006"
] | [
"13/01/2001",
"1/1/1800",
"10/32/2080",
"12/123/4322",
"234/423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/9",
"12/132/90",
"12/123/4322",
"234/423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/9",
"12/132/90",
"12/123/4322",
"234/423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/9",
"12/132/90"
] | 74 |
^\d*\.?((25)|(50)|(5)|(75)|(0)|(00))?$ | This is a pattern to search and verify that a decimal number ends with a 25, 50, 75, 0 or 00. It does match for a nothing after decimal also but I guess thats ok !! | This is a pattern to search and verify that a decimal number ends with a 25, 50, 75, 0 or 00. It also match for nothing after decimal or even without decimal point.
Match examples:
- "0.25"
- ".75"
- "123.50"
Non-match examples:
- ".77"
- "1.435" | [
"0.25",
".75",
"123.50",
"45091674723.",
"15584775298650162922847293711339482454366793954997125",
"9882085266649734497491.5",
"7268907166939050834340423712961385078969.50",
"870674387058196172857063",
"339138741572321245.75",
"652119432575.",
"654232119475.",
"652119475.25",
"652432119475.50"
] | [
".77",
"1.435",
"3.13",
"3124.324",
"423.52",
"312.452",
"423.4234.243",
"54.32",
"3124.5242",
"542.134",
"542.423",
"534.342435"
] | 75 |
^(\d{5}-\d{4}|\d{5})$|^([a-zA-Z]\d[a-zA-Z] \d[a-zA-Z]\d)$ | This is a modification of the zip code regular expression submitted by Steven Smith (ssmith@aspalliance.com)
It no longer matches 78754-12aA | This regular expression matches two patterns:
1. A valid U.S. ZIP code, which can be either in the format "12345-6789" or just "12345."
2. A valid Canadian postal code, which is in the format "A1A 1A1" (a letter, a digit, a letter, a space, a digit, a letter, a digit).
Match examples:
- "78754"
- "78754-1234"
- "G3H 6A3"
Non-match examples:
- "78754-12aA"
- "7875A" | [
"78754",
"78754-1234",
"G3H 6A3",
"c3s 0Z1",
"69402-6689",
"Y1R 9B0",
"V5l 2G4",
"00176",
"21458",
"86175-8760",
"20021-5752",
"D7b 2j3",
"89926"
] | [
"78754-12aA",
"7875A",
"g3h6a3",
"42324-412342",
"3c12-12334f2",
"vrf2-v32v4",
"32",
"verw2v-4v",
"4234",
"v43-v34v3v",
"f34-f43rv",
"5345-43534"
] | 80 |
^[A-Za-z]{1,2}[0-9A-Za-z]{1,2}[ ]?[0-9]{0,1}[A-Za-z]{2}$ | This regular expression can be used to validate UK postcodes. Especially useful if want to provide a client side validation on a web site. | This regular expression is used to validate codes with a specific format(UK postcodes), where the code starts with 1 to 2 letters, followed by 1 to 2 alphanumeric characters, an optional space, 0 to 1 digit, and ends with exactly 2 letters.
Match examples:
- "SW112LE"
- "SW11 2LE"
- "CR05LE"
Non-match examples:
- "12CR0LE"
- "12CR 0LE" | [
"SW112LE",
"SW11 2LE",
"CR05LE",
"AL52zp",
"gW 0bY",
"gRc7Fg",
"Cah0UE",
"VEz RE",
"Jc2IW",
"M2G1on",
"CYD bL",
"dSH4 6kM",
"RZ8Vn"
] | [
"12CR0LE",
"12CR 0LE",
"SWLE05",
"2534",
"511235",
"6134",
"FSSC VDVQWER4154",
"21V3D1FV14VF",
"F1FV13F4",
"V34FGB45345",
"AFDS23",
"DVS2"
] | 84 |
20\d{2}(-|\/)((0[1-9])|(1[0-2]))(-|\/)((0[1-9])|([1-2][0-9])|(3[0-1]))(T|\s)(([0-1][0-9])|(2[0-3])):([0-5][0-9]):([0-5][0-9]) | Sql date format tester. | This regular expression is used to validate date-time strings in a specific ISO 8601 format, where the year is in the 21st century, and it includes the year, month, day, hour, minute, and second components, separated by either hyphens or slashes, with a "T" or a space between the date and time.
Match examples:
- "2099-12-31T23:59:59"
- "2002/02/09 16:30:00"
- "2000-01-01T00:00:00"
Non-match examples:
- "2000-13-31T00:00:00"
- "2002/02/33 24:00:00" | [
"2099-12-31T23:59:59",
"2002/02/09 16:30:00",
"2000-01-01T00:00:00",
"2052/10-16T09:09:10",
"2041-10/30 23:21:00",
"2047/11-04T23:40:42",
"2041/09-04 03:05:18",
"2067-10/31 10:12:42",
"2033-10/31 18:12:50",
"2053-10/19T01:37:06",
"2002-11-13
09:52:58",
"2045-07/31T08:19:50",
"2084-08/25T22:13:40"
] | [
"2000-13-31T00:00:00",
"2002/02/33 24:00:00",
"2000-01-01 60:00:00",
"2084-08/25T98:13:40",
"2002/02/33 24:45:00",
"24323/02/33 24:00:00",
"2002/02/343 24:00:00",
"//::Gfsdfh9832",
"2000-01-01 60:99:99",
"2000-13-31T00:904829:00",
"2000-100-01 60:00:00",
"2000-01-100 60:00:00"
] | 86 |
^\d{4}[\-\/\s]?((((0[13578])|(1[02]))[\-\/\s]?(([0-2][0-9])|(3[01])))|(((0[469])|(11))[\-\/\s]?(([0-2][0-9])|(30)))|(02[\-\/\s]?[0-2][0-9]))$ | - validates a yyyy-mm-dd, yyyy mm dd, or yyyy/mm/dd date
- makes sure day is within valid range for the month
- does NOT validate Feb. 29 on a leap year, only that Feb. CAN have 29 days | - validates a yyyy-mm-dd, yyyy mm dd, or yyyy/mm/dd date
- makes sure day is within valid range for the month
- does NOT validate Feb. 29 on a leap year, only that Feb. CAN have 29 days
Match examples:
- "0001-12-31"
- "9999 09 30"
- "2002/03/03"
Non-match examples:
- "0001\02\30"
- "9999.15.01" | [
"0001-12-31",
"9999 09 30",
"2002/03/03",
"7518 0814",
"46650831",
"3886 09 11",
"005002-10",
"21101214",
"941211/09",
"5625 0227",
"1538 02 04",
"5043 0618",
"39270910"
] | [
"0001\\02\\30",
"9999.15.01",
"2002/3/3",
"39270910243",
"234/423/5243",
"21/53/52353",
"43-5432",
"/5/5/20022",
"245/524/12",
"354/243/542",
"9/9/9",
"12/132/90"
] | 87 |
^(1?(-?\d{3})-?)?(\d{3})(-?\d{4})$ | US Telephone Reg expression that allows 7, 10 or 11 digits with or without hyphens. | US Telephone Reg expression that allows 7, 10 or 11 digits with or without hyphens.
Match examples:
- "15615552323"
- "1-561-555-1212"
- "5613333"
Non-match examples:
- "1-555-5555"
- "15553333" | [
"15615552323",
"1-561-555-1212",
"5613333",
"891-0191149",
"4662065",
"329-6361",
"277-9964574",
"882-6119",
"1-044788-3245",
"5383738",
"174-2712",
"1-639-3507476",
"722-0291"
] | [
"1-555-5555",
"15553333",
"0-561-555-1212",
"423142",
"412",
"13451435",
"143534551",
"164351345134",
"BG323T",
"wrtb",
"4fc34f",
"---1--1--12-3-4"
] | 89 |
([a-zA-Z]:(\\w+)*\\[a-zA-Z0_9]+)?.xls | This RegEx will help to validate a physical file path with a specific file extension (here xls) | This RegEx will help to validate a physical file path with a specific file extension (here xls)
Match examples:
- "E:\DyAGT\SD01A_specV2.xls"
- "E:\DyAGT\23FD.xls"
- "C:\DyAGT\VF2FV.xls"
Non-match examples:
- "E:\DyAGT\SD01A_specV2.txt"
- "E:\DyAGT\SD01A_specV2.jpg" | [
"E:\\DyAGT\\SD01A_specV2.xls",
"E:\\DyAGT\\23FD.xls",
"C:\\DyAGT\\VF2FV.xls",
"C:\\F23V\\SD01A_specV2.xls",
"C:\\DyAGT\\F32V.xls",
"F:\\F23V\\SD01A_specV2.xls",
"F:\\DyAGT\\gfb34.xls",
"E:\\g34bg\\SD01A_specV2.xls",
"D:\\DyAGT\\3g4b3.xls",
"D:\\g3rbg\\SD01A_specV2.xls",
"D:\\DyAGT\\Sgbr3.xls",
"D:\\DyAGT\\SD3rgbA_specV2.xls",
"E:\\DyAr3br3g3GT\\SD01A_specV2.xls"
] | [
"E:\\DyAGT\\SD01A_specV2.txt",
"E:\\DyAGT\\SD01A_specV2.jpg",
"E:\\DyAGT\\fad.txt",
"E:\\fadsfads\\SD01A_specV2.txt",
"E:\\DyAGT\\XLS",
"E:\\DyAGT\\SD01A_specV2.md",
"C:\\DyAGT\\SD01A_fadsfdasspecV2.md",
"C:\\DyAGT\\fadsfad123.md",
"C:\\fads234\\fadsfad123.md",
"C:\\afdsGSFD\\fadsfad123.md",
"C:\\DyAGT\\DSAG42.md",
"ADSF@FADSFXLS"
] | 92 |
^( [1-9]|[1-9]|0[1-9]|10|11|12)[0-5]\d$ | Matches a 12-hour time value expressed as either 4 numeric digits, 3 numeric digits, or a space and 3 numeric digits. 3 digit times (930) can be expressed with leading 0's (0930) or not. AM/PM designation is not included in this expression. | Matches a 12-hour time value expressed as either 4 numeric digits, 3 numeric digits, or a space and 3 numeric digits. 3 digit times (930) can be expressed with leading 0's (0930) or not. AM/PM designation is not included in this expression.
Match examples:
- "1145"
- "933"
- "801"
Non-match examples:
- "0000"
- "1330" | [
"1145",
"933",
"801",
"1051",
"529",
"1210",
"1226",
"1031",
"1145",
"0457",
"1106",
"1234",
"240"
] | [
"0000",
"1330",
"8:30",
"8498",
"4512",
"4512F45",
"983",
"21654",
"9823",
"2623",
"6872",
"16578"
] | 94 |
^\d{1,2}\/\d{2,4}$ | Accepts 1-2 digits followed by a slash followed by 2-4 digits. Useful for numeric month/year entry. | Accepts 1-2 digits followed by a slash followed by 2-4 digits.
Match examples:
- "9/02"
- "09/2002"
- "09/02"
Non-match examples:
- "Fall 2002"
- "Sept 2002" | [
"9/02",
"09/2002",
"09/02",
"70/661",
"52/086",
"7/2550",
"6/958",
"38/46",
"89/6259",
"08/125",
"3/470",
"4/6039",
"0/971"
] | [
"Fall 2002",
"Sept 2002",
"651/561",
"651/89",
"1651/1",
"61/87465",
"987/8",
"5846/564",
"115/514",
"564/26589",
"45/15673",
"486/465123"
] | 95 |
^(|(0[1-9])|(1[0-2]))\/((0[1-9])|(1\d)|(2\d)|(3[0-1]))\/((\d{4}))$ | This expression matches dates formatted as MM/DD/YYYY where months and days must be 2 digits each, zero padded. It is not perfect - it allows DD to be from 01 to 31 regardless of the month. | This expression matches dates formatted as MM/DD/YYYY where months and days must be 2 digits each, zero padded. It allows DD to be from 01 to 31 regardless of the month.
Match examples:
- "01/01/2001"
- "02/30/2001"
- "12/31/2002"
Non-match examples:
- "1/1/02"
- "1/1/2002" | [
"01/01/2001",
"02/30/2001",
"12/31/2002",
"10/06/7411",
"03/31/7001",
"10/30/6747",
"11/30/1618",
"10/18/8654",
"01/11/2633",
"05/08/9895",
"08/30/1968",
"10/23/1386",
"07/11/0558"
] | [
"1/1/02",
"1/1/2002",
"1/25/2002",
"12/123/4322",
"234/423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/9",
"12/132/90"
] | 96 |
^((((0[13578])|(1[02]))[\/]?(([0-2][0-9])|(3[01])))|(((0[469])|(11))[\/]?(([0-2][0-9])|(30)))|(02[\/]?[0-2][0-9]))[\/]?\d{4}$ | Date expressions that matches MM/DD/YYYY where MM and DD must be two digits and zero padded. Validates correctly for all months except February, which it assumes to always have 29 days. The "/" separator is optional. | Date expressions that matches MM/DD/YYYY where MM and DD must be two digits and zero padded. Validates correctly for all months except February, which it assumes to always have 29 days.
Match examples:
- "01/01/2001"
- "02/29/2002"
- "12/31/2002"
Non-match examples:
- "1/1/02"
- "02/30/2002" | [
"01/01/2001",
"02/29/2002",
"12/31/2002",
"02/08/9410",
"12/30/0469",
"04/23/4757",
"02/16/1146",
"02/21/4951",
"02/16/5725",
"04/30/9714",
"02/22/0322",
"02/07/8335",
"03/31/7591"
] | [
"1/1/02",
"02/30/2002",
"1/25/2002",
"12/123/4322",
"234/423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/9",
"12/132/90"
] | 97 |
^(\d{1,3}'(\d{3}')*\d{3}(\.\d{1,3})?|\d{1,3}(\.\d{3})?)$ | This regex match numeric data in the following format: thousands are separated by (') apostrophe, decimal places are separated by dot (.) Maximum three decimal places are not required. It's easy to change to other separators as well. | This regex match numeric data in the following format: thousands are separated by (') apostrophe, decimal places are separated by dot (.) Maximum three decimal places are not required.
Match examples:
- "1'235.140"
- "1'222'333.120"
- "456"
Non-match examples:
- "1234.500"
- "78'45.123" | [
"1'235.140",
"1'222'333.120",
"456",
"88'424'905'415'870'699'285'830'800'903'879'489'436'003'210'644'340'569'556'469'475'309'055'661'827'487'006'380'173'497'118'326'412'807'895'326'354'231'911'768'449'680'069'565'892'099'646",
"61",
"7.680",
"704'674'688'969'072'125'803'066'981'104'566'546'762'823'774'192'515'690'535'442'327'444'253'062'055'867'618'971'274'103'898'110'314'260'988'864'448'282",
"8.994",
"044'460'463'314'543'430'078'086'902.8",
"0'204'839'396'143'045'546'478'160'791'591'415'414'532'729'941'933'374'184'756'933'515'705'683'090'047'631'201'287'271'916'852'943'106'297'549'637'040'683'634'664'375'759'438'357'499'337'979'149'266'238'139'511'076'976'138'616'984'064'975'705'850'930",
"523",
"11.117",
"388.687"
] | [
"1234.500",
"78'45.123",
"123,0012",
"f2314132",
"1v231v4",
"1234v.4132.1423",
"64563.1234.5234",
"@#$.423",
"234b.25342354",
"524352344352'35342'325.2341",
"132F4132F.12F143F2",
"54B35G3.53G5G3"
] | 98 |
^((0?[1-9]|[12][1-9]|3[01])\.(0?[13578]|1[02])\.20[0-9]{2}|(0?[1-9]|[12][1-9]|30)\.(0?[13456789]|1[012])\.20[0-9]{2}|(0?[1-9]|1[1-9]|2[0-8])\.(0?[123456789]|1[012])\.20[0-9]{2}|(0?[1-9]|[12][1-9])\.(0?[123456789]|1[012])\.20(00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96))$ | Fully functional date validator in format dd.MM.yyyy
Works only within range of years 2000-2099 !
It allows leading zeros but does not require them. The last year pattern (enumeration) is not very clever but I will improve it, if needed. | Fully functional date validator in format dd.MM.yyyy
Works only within range of years 2000-2099 !
It allows leading zeros but does not require them.
Match examples:
- "31.01.2002"
- "29.2.2004"
- "09.02.2005"
Non-match examples:
- "31.11.2002"
- "29.2.2002" | [
"31.01.2002",
"29.2.2004",
"09.02.2005",
"26.12.2093",
"2.08.2004",
"15.4.2053",
"02.9.2089",
"3.10.2039",
"01.08.2013",
"12.8.2096",
"24.03.2092",
"01.7.2012",
"30.12.2055"
] | [
"31.11.2002",
"29.2.2002",
"33.06.2000",
"12/123/4322",
"234/423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"31/9/9",
"12/132/90"
] | 99 |
^(0[1-9]|1[0-2])\/((0[1-9]|2\d)|3[0-1])\/(19\d\d|200[0-3])$ | This expression is an attempt to match the most obvious features of a valid date in American/US format of the form mm/dd/yyyy for any year 1900 through 2003. It can easily be adapted for different date ranges. It matches any date where the day part is any number 01-31, the month part is any number 01-12, and the year part is any number 1900-2003. The only invalid dates that it matches are ones where the day part may be in the range 01-31 but that range might not be valid for the specified month. An example of an invalid date that it would allow to pass through would be 11/31/2002. This date is invalid because 11/31 of any year does not exist, but this expression would allow it pass through since the day part is in the range 01-31.
This regular expression has been used successfully in ASP with VBScript using the windows scripting library RegExp object. | This expression is an attempt to match the most obvious features of a valid date in American/US format of the form mm/dd/yyyy for any year 1900 through 2003. It matches any date where the day part is any number 01-31, the month part is any number 01-12, and the year part is any number 1900-2003. The only invalid dates that it matches are ones where the day part may be in the range 01-31 but that range might not be valid for the specified month. An example of an invalid date that it would allow to pass through would be 11/31/2002. This date is invalid because 11/31 of any year does not exist, but this expression would allow it pass through since the day part is in the range 01-31.
Match examples:
- "12/31/2003"
- "01/01/1900"
- "11/31/2002"
Non-match examples:
- "1/1/2002"
- "01/01/02" | [
"12/31/2003",
"01/01/1900",
"11/31/2002",
"10/31/2003",
"03/31/1975",
"10/02/2001",
"10/29/2000",
"05/05/1935",
"11/30/2000",
"08/31/1996",
"11/21/2001",
"02/05/1941",
"10/01/1931"
] | [
"1/1/2002",
"01/01/02",
"01/01/2004",
"12/123/4322",
"234/423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/99/9",
"12/132/90"
] | 100 |
^((((0[13578])|([13578])|(1[02]))[\/](([1-9])|([0-2][0-9])|(3[01])))|(((0[469])|([469])|(11))[\/](([1-9])|([0-2][0-9])|(30)))|((2|02)[\/](([1-9])|([0-2][0-9]))))[\/]\d{4}$|^\d{4}$ | The following validates dates with and without leading zeros in the following formats: MM/DD/YYYY and it also takes YYYY (this can easily be removed). All months are validated for the correct number of days for that particular month except for February which can be set to 29 days. date day month year | The following validates dates with and without leading zeros in the following formats: MM/DD/YYYY and it also takes YYYY. All months are validated for the correct number of days for that particular month except for February which can be set to 29 days. date day month year
Match examples:
- "01/01/2001"
- "1/01/2001"
- "2002"
Non-match examples:
- "2/30/2002"
- "13/23/2002" | [
"01/01/2001",
"1/01/2001",
"2002",
"08/31/0540",
"04/30/8307",
"4353",
"11/11/7404",
"04/4/1252",
"6488",
"6118",
"03/27/0608",
"11/30/8589",
"1/9/8118"
] | [
"2/30/2002",
"13/23/2002",
"12345",
"14314351",
"15431543",
"65763576",
"76556",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/97777",
"12/132/90"
] | 103 |
^[-+]?\d+(\.\d+)?$ | This matches any real number, with optional decimal point and numbers after the decimal, and optional positive (+) or negative (-) designation. | This matches any real number, with optional decimal point and numbers after the decimal, and optional positive (+) or negative (-) designation.
Match examples:
- "123"
- "-123.45"
- "+123.56"
Non-match examples:
- "123x"
- ".123" | [
"123",
"-123.45",
"+123.56",
"512345",
"5",
"25432",
"234",
"534.53",
"+4145",
"-423",
"222",
"742",
"7225464526"
] | [
"123x",
".123",
"-123.",
"2435.2543.53245",
"243551-3425",
"2/3/5235",
"43-5432",
"254627g.256",
"432/524/2435",
"1-1-2",
"34.31sd",
"++63453.345"
] | 108 |
^((\d{5}-\d{4})|(\d{5})|([A-Z]\d[A-Z]\s\d[A-Z]\d))$ | This expression matches three different formats of postal codes: 5 digit US ZIP code, 5 digit US ZIP code + 4, and 6 digit alphanumeric Canadian Postal Code. The first one must be 5 numeric digits. The ZIP+4 must be 5 numeric digits, a hyphen, and then 4 numeric digits. The Canadian postal code must be of the form ANA NAN where A is any uppercase alphabetic character and N is a numeric digit from 0 to 9. | This expression matches three different formats of postal codes: 5 digit US ZIP code, 5 digit US ZIP code + 4, and 6 digit alphanumeric Canadian Postal Code. The first one must be 5 numeric digits. The ZIP+4 must be 5 numeric digits, a hyphen, and then 4 numeric digits. The Canadian postal code must be of the form ANA NAN where A is any uppercase alphabetic character and N is a numeric digit from 0 to 9.
Match examples:
- "44240"
- "44240-5555"
- "T2P 3C7"
Non-match examples:
- "44240ddd"
- "t44240-55" | [
"44240",
"44240-5555",
"T2P 3C7",
"02580-6821",
"41092-0763",
"63340-6274",
"P4I 5O7",
"C9C 5L6",
"C3T 2Q5",
"17021-8260",
"79433",
"30395",
"22696"
] | [
"44240ddd",
"t44240-55",
"t2p3c7",
"veq23vr",
"23vr",
"v23rrg2",
"v232n2g",
"grn2",
"432523545-345",
"5435-534225",
"9/9/9",
"3409fjg43"
] | 110 |
^\d{5}(-\d{3})?$ | Matches standard 5 digit Brazilian Postal Codes (CEP), or the CEP + 3 digits (distribution identifiers - suffix).
For more info refer to: http://www.correios.com.br/servicos/cep/Estrutura_CEP.cfm (in portuguese). | Matches strings that consist of either exactly five digits or five digits followed by a hyphen and then exactly three more digits (optional). Can be used to match standard 5 digit Brazilian Postal Codes (CEP), or the CEP + 3 digits (distribution identifiers - suffix).
Match examples:
- "13165-000"
- "38175-000"
- "81470-276"
Non-match examples:
- "13165-00"
- "38175-abc" | [
"13165-000",
"38175-000",
"81470-276",
"06959",
"23625",
"54551-990",
"06611",
"83396-591",
"82624",
"70036",
"94193",
"41467-951",
"93134-586"
] | [
"13165-00",
"38175-abc",
"81470-2763",
"12312-3123",
"243-234",
"43-234",
"654324",
"436254-",
"5468",
"897-",
"789798",
"789798-8798"
] | 113 |
^\$(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$ | This re matches US currency format with lead dollar sign. Dollar value must have at least one digit and may or may not be comma separated. Cents value is optional. | Matches US currency format with lead dollar sign. Dollar value must have at least one digit and may or may not be comma separated. Cents value is optional.
Match examples:
- "$0.84"
- "$123458"
- "$1,234,567.89"
Non-match examples:
- "$12,3456.01"
- "12345" | [
"$0.84",
"$123458",
"$1,234,567.89",
"$969,815,896,348,781",
"$423098",
"$9084320.24",
"$439872",
"$43920",
"$324.32",
"$34.32",
"$490283",
"$43.78",
"$432"
] | [
"$12,3456.01",
"12345",
"$1.234",
"$32423.42323",
"$3242jdsa",
"4298234",
"43-5432",
"/5/5/20022",
"245/524/12",
"1-1-2",
"(0xx12) 62509",
"++63453.345"
] | 114 |
(^([0-9]|[0-1][0-9]|[2][0-3]):([0-5][0-9])$)|(^([0-9]|[1][0-9]|[2][0-3])$) | Matches a string if it is a valid time in the format of HH:MM / H:MM / HH / H | Matches a string if it is a valid 24-hour time representations in the format of HH:MM / H:MM / HH / H
Match examples:
- "10:35"
- "9:20"
- "23"
Non-match examples:
- "24:00"
- "20 PM" | [
"10:35",
"9:20",
"23",
"9",
"9:23",
"8:38",
"18:07",
"06:10",
"02:05",
"04:59",
"11",
"4",
"9"
] | [
"24:00",
"20 PM",
"20:15 PM",
"12/123/4322",
"234",
"123",
"43-5432",
"/5/5/20022",
"000-000",
"41",
"34.31",
"32542"
] | 117 |
^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(\.[0-9][0-9])?$ | Matches US currency input with or without commas. This provides a fix for the currency regular expression posted at http://regxlib.com/REDetails.aspx?regexp_id=70 by escaping the . (period) to ensure that no other characters may be used in it's place. | Matches currency values with optional dollar signs, allowing for thousands separators and cents.
Match examples:
- "$3,023,123.34"
- "9,876,453"
- "123456.78"
Non-match examples:
- "4,33,234.34"
- "$1.234" | [
"$3,023,123.34",
"9,876,453",
"123456.78",
"234",
"432.54",
"3",
"4",
"9.99",
"$53.54",
"$65.54",
"$1.19",
"$99.87",
"$54.32"
] | [
"4,33,234.34",
"$1.234",
"abc",
"12/123/4322",
"2346-2345-2435",
"2/3/5235",
"43-5432",
"423.43242a34234",
"432/524/2435",
"(0xx12) 7256 2345154",
"9/9/9",
"3409fjg43"
] | 118 |
^\$?\d+(\.(\d{2}))?$ | To evaluate an amount with or without a dollar sign where the cents are optional. | ^\$?\d+(\.(\d{2}))?$
Match examples:
- "$2.43"
- "2.02"
- "$2112"
Non-match examples:
- "2.1"
- "$.14" | [
"$2.43",
"2.02",
"$2112",
"$619533",
"$141894391704967218837972239156475932407",
"423423",
"$653",
"7256",
"7452.54",
"$745",
"$725",
"824",
"$742.35"
] | [
"2.1",
"$.14",
"$2,222.12",
"435.534",
"$5.345",
"$543$54",
"$-123.2344",
"$234.234",
"$543.2623",
"3450.23948",
"234.432",
"222.333"
] | 119 |
((0[1-9])|(1[02]))/\d{2} | Fromat check for MM/YY, checks month is 1-12 and any 2 digit year. | Fromat check for MM/YY, checks month is 1-12 and any 2 digit year.
Match examples:
- "01/00"
- "12/99"
- "10/30"
Non-match examples:
- "13/00"
- "12/AS" | [
"01/00",
"12/99",
"10/30",
"10/21",
"12/55",
"02/85",
"06/46",
"10/11",
"10/46",
"12/34",
"02/57",
"06/47",
"10/52"
] | [
"13/00",
"12/AS",
"123/124",
"432/5135/1",
"123.1351",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/24",
"9/9/9",
"92/90"
] | 120 |
^([0-9]{2})?(\([0-9]{2})\)([0-9]{3}|[0-9]{4})-[0-9]{4}$ | A simple expression to brazilian phone number code, with international code.
Simple DDI without "+" 99 plus simple DDD (99) plus simple local phone number 3 or 4 digits plus "-" plus 4 digits. | This regular expression is designed to match Brazilian phone numbers that include an international dialing code (DDI) without the plus sign, a simple area code (DDD) enclosed in parentheses, a simple local phone number consisting of either 3 or 4 digits, followed by a hyphen, and finally, a 4-digit extension.
Match examples:
- "55(21)123-4567"
- "(11)1234-5678"
- "55(71)4562-2234"
Non-match examples:
- "3434-3432"
- "4(23)232-3232" | [
"55(21)123-4567",
"(11)1234-5678",
"55(71)4562-2234",
"87(37)790-8395",
"(14)7637-0089",
"06(10)5683-0265",
"(17)730-8237",
"(11)416-7050",
"19(96)4663-8089",
"28(23)0153-6864",
"52(18)651-3567",
"(21)157-5399",
"47(71)362-9412"
] | [
"3434-3432",
"4(23)232-3232",
"55(2)232-232",
"12/123/4322",
"(234)423425",
"243234()2342340",
"()234234",
"(423)42309243",
"($32)524308",
"+434234(4234)",
"23=4234-98324",
"24302348-23489(13)"
] | 123 |
^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*))+\.(txt|TXT)$ | This RE validates a path/file of type txt (text file)
This RE can be used as a filter on certain file types, while insuring the entire string is a fully qualified path and file. The filter value can be changed or added to as you need | This RE validates a path/file of type txt (text file), while insuring the entire string is a fully qualified path and file.
Match examples:
- "c:\file.txt"
- "c:\folder\sub folder\file.txt"
- "\\network\folder\file.txt"
Non-match examples:
- "C:"
- "C:\file.xls" | [
"c:\\file.txt",
"c:\\folder\\sub folder\\file.txt",
"\\\\network\\folder\\file.txt",
"c:\\adsf.txt",
"c:\\ghaf.txt",
"c:\\tqre.txt",
"d:\\agsha.txt",
"d:\\dasf\\fasd.txt",
"d:\\firqewle.txt",
"e:\\folder\\sub folder\\test.txt",
"e:\\gad\\afds\\sub folder\\file.txt",
"e:\\folder\\sub aafs\\file.txt",
"e:\\folder\\subafdfolder\\file.txt"
] | [
"C:",
"C:\\file.xls",
"folder.txt",
"akfd.jp",
"fafds.jpg",
"abc.png",
"fasdfa.tst",
"sfdarq123.txt",
"asdf.vsw",
"wersdf.txu",
"fsda.twe",
"rwe.ter"
] | 125 |
^[a-zA-Z0-9]+([a-zA-Z0-9\-\.]+)?\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$ | Checks domain names. This is an attempt to deal with some of the issues of the other reg ex in not handling leading periods(.) and hypens(-). | Used to validate domain names that start with alphanumeric characters, may contain additional alphanumeric characters, hyphens, and periods in the middle (optionally), and end with one of the specified TLDs (case-insensitive).
Match examples:
- "my.domain.com"
- "regexlib.com"
- "big-reg.com"
Non-match examples:
- ".mydomain.com"
- "regexlib.comm" | [
"my.domain.com",
"regexlib.com",
"big-reg.com",
"x7E6vd6bn9lVKV0UvDZjDca14Pxfd42DQ2ue7A3KP.org",
"F60CAbjTaI28WV4APmn.ORG",
"4ozPd3VhUT4UbPSxAd74tdnSKlPE.org",
"br9Gf5bwzVWg3SvjGO2N0A7ZXVf1Ex.net",
"3MOHUK1ssVZ.ORG",
"biF.com",
"Ov4M1oQuzhAwsHOpx6Rm.edu",
"eMxw3wFMwZHeGv7pR6IX4Xwxi6MbKTmSxKgedUn9h0fFLD.U0pwr4yV7dInK5frNbyRghfA0IkWKsTg.edu",
"LaYx5MdIy4pGlJ.com",
"ZDbQ57LlDzhRbUVeK4zPc.EDU"
] | [
".mydomain.com",
"regexlib.comm",
"-bigreg.com",
"afdsaf.adijs",
"a.cdsaca.cas",
"43.v234",
"@#dfkjnav",
"12f3.21f3.213f",
"qwerty@123.123",
"341.431v4f3.fv1",
"notredame.github",
"99999@gmail"
] | 126 |
^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$ | This matches floating point expression in a more rigorous way - accepts both exponent as well as non exponent notations. | Matches numbers that can be positive or negative, may have a decimal point, and can be in scientific notation format
Match examples:
- "123"
- "-123.35"
- "-123.35e-2"
Non-match examples:
- "abc"
- "123.32e" | [
"123",
"-123.35",
"-123.35e-2",
"41",
"1432",
"512",
"123",
"77680628136.7552098e982",
"+76780107092975139",
"+7678023024785.3e-19982",
"275189806858986728960918281818983794084608877641099649684838072428225393435789.38e05143381004",
"-432.52",
"2e10"
] | [
"abc",
"123.32e",
"123.32.3",
"12/123/4322",
"51:534",
"43.v234",
"43-5432",
"/5/5/20022",
"000-000",
"1-1-2",
"34.31ee",
"12/132/90"
] | 127 |
^((([0]?[1-9]|1[0-2])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?( )?(AM|am|aM|Am|PM|pm|pM|Pm))|(([0]?[0-9]|1[0-9]|2[0-3])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?))$ | Matches times seperated by either : or . will match a 24 hour time, or a 12 hour time with AM or PM specified. Allows 0-59 minutes, and 0-59 seconds. Seconds are not required. | Matches times seperated by either : or . will match a 24 hour time, or a 12 hour time with AM or PM specified. Allows 0-59 minutes, and 0-59 seconds. Seconds are not required.
Match examples:
- "1:01 AM"
- "23:52:01"
- "03.24.36 AM"
Non-match examples:
- "19:31 AM"
- "9:9 PM" | [
"1:01 AM",
"23:52:01",
"03.24.36 AM",
"01.12",
"1.44PM",
"10.17.53 am",
"14.51:24",
"03.34",
"07:45.39PM",
"02:43 aM",
"23.58",
"4:21PM",
"17.50:18"
] | [
"19:31 AM",
"9:9 PM",
"25:60:61",
"12/123/4322",
"2346-2345-2435",
"2/3/5235",
"/5/5/5",
"254627g.256",
"123:234:234",
"12:60:423",
"999:999:999",
"12/132/90"
] | 132 |
^[a-zA-Z0-9\s.\-_']+$ | Alphanumeric, hyphen apostrophe, comma dash spaces | Match strings that consist of alphanumeric characters, spaces, periods (dots), hyphens, underscores, and single quotation marks.
Match examples:
- "dony d'gsa"
- "adsfaq9"
- "f231v3"
Non-match examples:
- "^[a-zA-Z0-9\s.\-_']+$"
- "+SDF4324$#*" | [
"dony d'gsa",
"adsfaq9",
"f231v3",
"f34v2f3",
"f3v2f4",
"vad.adsfv",
"adfq3_fvs",
"fdsv.sd_",
"q34",
"g4b3w...",
"54_ sfdg",
"dfsg-gsdf_",
"avaf_fewav"
] | [
"^[a-zA-Z0-9\\s.\\-_']+$",
"+SDF4324$#*",
"%$@$#+342",
"%$(*#(%+24dfsv",
"^&*",
"#@$",
"($@*#$+#$%",
"3548345$@+#$",
"+@!#$#",
"*$(#@%",
"*%&$*($#`",
"$~#@$$"
] | 133 |
^\d{0,2}(\.\d{1,2})?$ | This regular expression validates that the data entered is a number with a maximum of two integers and two decimals and a minimum of one integer or one decimal. | This regular expression validates that the data entered is a number with a maximum of two integers and two decimals and a minimum of one integer or one decimal.
Match examples:
- "99.99"
- "99"
- ".99"
Non-match examples:
- "999.999"
- "999" | [
"99.99",
"99",
".99",
"1",
"78",
"12",
"9.2",
"4.0",
"8.1",
"8.64",
"76",
"19.9",
"86"
] | [
"999.999",
"999",
".999",
"-123",
"234",
"123",
"-312",
"/5/5/20022",
"000-000",
"1-1-2",
"34.31141",
"32542"
] | 139 |
^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$ | This will grep for a valid MAC address , with colons seperating octets. It will ignore strings too short or long, or with invalid characters. It will accept mixed case hexadecimal. Use extended grep. | This will grep for a valid MAC address , with colons seperating octets. It will ignore strings too short or long, or with invalid characters. It will accept mixed case hexadecimal. Use extended grep.
Match examples:
- "01:23:45:67:89:ab"
- "01:23:45:67:89:AB"
- "fE:dC:bA:98:76:54"
Non-match examples:
- "01:23:45:67:89:ab:cd"
- "01:23:45:67:89:Az" | [
"01:23:45:67:89:ab",
"01:23:45:67:89:AB",
"fE:dC:bA:98:76:54",
"44:4a:8F:Af:52:Ca",
"74:30:F2:Ad:AB:05",
"a7:b6:e8:2F:Aa:08",
"Cb:26:29:03:c8:dC",
"D5:dc:86:7f:De:E2",
"E5:88:9f:cb:5E:4D",
"6C:F1:ff:D5:CD:2D",
"57:cB:aC:DF:1b:79",
"2e:5b:cA:8c:6b:7A",
"BD:D4:0b:D5:5d:e0"
] | [
"01:23:45:67:89:ab:cd",
"01:23:45:67:89:Az",
"01:23:45:56:",
"12/123/4322",
"51:534",
"243:234:423:5234",
"53426:525234",
"12f3.21f3.213f",
"432/524/2435",
"341.431v4f3.fv1",
"2434:542:523:2345",
"12/132/90"
] | 141 |
^100$|^[0-9]{1,2}$|^[0-9]{1,2}\,[0-9]{1,3}$ | Percentage with 3 number after comma. | This regular expression can match three different patterns:
The exact string "100."
One or two-digit numbers.
Numbers in a specific format with one or two digits, a comma, and one to three digits.
Match examples:
- "12,654"
- "1,987"
- "43,582"
Non-match examples:
- "128,2"
- "12," | [
"12,654",
"1,987",
"43,582",
"59,582",
"2,582",
"52,482",
"59,749",
"58,960",
"4,683",
"53",
"54",
"9",
"1"
] | [
"128,2",
"12,",
"453,5345,534",
"534,345,345,453,25",
",54325,45",
"534,2,5",
"54,35,235",
"543,536,43",
"5,43,634,534",
"5,43,5345,43",
"534,534,6345,,35",
"54,3534"
] | 142 |
^(([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/[2][0]\d{2})$|^(([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/[2][0]\d{2}\s([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d)$ | Correct French DateTime(DD/MM/YYYY OR DD/MM/YYYY HH:MM:SS) | Correct French DateTime(DD/MM/YYYY OR DD/MM/YYYY HH:MM:SS)
Match examples:
- "12/01/2002"
- "12/01/2002 12:32:10"
- "30/04/2089"
Non-match examples:
- "32/12/2002"
- "12/13/2001" | [
"12/01/2002",
"12/01/2002 12:32:10",
"30/04/2089",
"01/06/2051 11:45:19",
"31/01/2040 21:52:00",
"30/10/2064 23:22:41",
"30/11/2022",
"27/11/2043",
"30/11/2061",
"14/05/2075",
"31/11/2038",
"23/10/2062 11:38:00",
"30/12/2041"
] | [
"32/12/2002",
"12/13/2001",
"12/02/06",
"12/123/4322",
"234/423/5243",
"2/3/52355",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/95341",
"12/132/90"
] | 143 |
^([a-zA-Z0-9][-a-zA-Z0-9]*[a-zA-Z0-9]\.)+([a-zA-Z0-9]{3,5})$ | Host/Domain name validation for perl.
Should be combined with a check for
length <= 63 characters and that $2
is in a list of top-level domains. | Matches domain names with subdomains and enforces certain rules such as starting and ending with alphanumeric characters, allowing hyphens in subdomains, and specifying a TLD with 3 to 5 characters.
Match examples:
- "freshmeat.net"
- "123.com"
- "TempLate-toolkKt.orG"
Non-match examples:
- "-dog.com"
- "?boy.net" | [
"freshmeat.net",
"123.com",
"TempLate-toolkKt.orG",
"baidu.com",
"kugou.com",
"google.com",
"ads.com",
"apple.com",
"openai.com",
"nd.edu",
"app.net",
"happy.org",
"handsome.org"
] | [
"-dog.com",
"?boy.net",
"this.domain",
"cqerc.9j9jafds",
"sfalijad234",
"3nf@.afdsgadsf",
"@#dfkjnav.agffe",
"%jfkdlddf@#FD",
"u09nKLJG FSL",
"com.edu.github",
"(0xx12) 62509",
"99999@gmail"
] | 145 |
^[^']*$ | This one matches all strings that do not contain the single quotation mark ('). | This one matches all strings that do not contain the single quotation mark (').
Match examples:
- "asljas"
- "%/&89uhuhadjkh"
- ""hi there!""
Non-match examples:
- "'hi there!'"
- "It's 9 o'clock" | [
"asljas",
"%/&89uhuhadjkh",
""hi there!"",
"fqqea",
"dF(D*SHF*f",
"3443gb",
"45bgb45g",
"b4b5b*G&&USDF",
"dsg$#R",
"FSDF#@FW#F",
"f#4f$#F",
"$F#$FFSDfsdew",
"fewf&*("
] | [
"'hi there!'",
"It's 9 o'clock",
"'''''",
"dhjggh'hdsfj",
"jkljasdlkj09'afds",
"'fdsa'fad'fdas",
"fds'ajsdlk",
"'fdskalj'lkfa9'FADSKFDA",
"FDSA'FJDIS(*&$F",
"'DSFAFJ*(FDS'FDSA",
"DFJSL'98DF'FSDIO",
"JSDLKF'SDF''FDS''FS"
] | 146 |
^([1-9]|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$ | This validates a number between 1 and 255. Could be modified to IP, or just to verify a number in a range. | Validates a number between 1 and 255.
Match examples:
- "1"
- "108"
- "255"
Non-match examples:
- "01"
- "256" | [
"1",
"108",
"255",
"142",
"151",
"124",
"165",
"45",
"85",
"75",
"36",
"218",
"215"
] | [
"01",
"256",
"534798",
"0948",
"54390",
"54398",
"9393",
"-432",
"324df",
"1-1-2",
"9/9/9",
"12/132/90"
] | 147 |
^[0-9](\.[0-9]+)?$ | matches non-negative decimal floating points numbers less than 10 | Matches non-negative decimal floating points numbers less than 10
Match examples:
- "1.2345"
- "0.00001"
- "7"
Non-match examples:
- "12.2"
- "1.10.1" | [
"1.2345",
"0.00001",
"7",
"1",
"6",
"9",
"6.7",
"5.854",
"9.563",
"4.4875",
"8.4657",
"3.654373",
"7.37654"
] | [
"12.2",
"1.10.1",
"15.98",
"-123",
"234",
"123",
"-312",
"12f3.21f3.213f",
"432/524/2435",
"1-1-2",
"34.31",
"534534.94534"
] | 149 |
^((((31\/(0?[13578]|1[02]))|((29|30)\/(0?[1,3-9]|1[0-2])))\/(1[6-9]|[2-9]\d)?\d{2})|(29\/0?2\/(((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))|(0?[1-9]|1\d|2[0-8])\/((0?[1-9])|(1[0-2]))\/((1[6-9]|[2-9]\d)?\d{2})) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$ | this expression validates a date-time field in European d/m/y h:m:s format. It is a european variation of Michael Ash's date-validation expression in this library.
The days are validated for the given month and year. Leap years are validated for all 4 digits years from 1600-9999, and all 2 digits years except 00 | This expression validates a date-time field in European d/m/y h:m:s format. The days are validated for the given month and year. Leap years are validated for all 4 digits years from 1600-9999, and all 2 digits years except 00
Match examples:
- "29/02/2004 20:15:27"
- "29/2/04 8:9:5"
- "31/3/2004 9:20:17"
Non-match examples:
- "29/02/2003 20:15:15"
- "2/29/04 20:15:15" | [
"29/02/2004 20:15:27",
"29/2/04 8:9:5",
"31/3/2004 9:20:17",
"12/12/10 23:5:58",
"30/6/6805 22:11:01",
"31/3/1840 22:15:28",
"29/2/8400 21:8:46",
"31/01/9934 20:45:5",
"30/12/4789 20:09:27",
"29/02/12 22:7:58",
"02/02/3840 22:2:30",
"06/11/52 21:5:00",
"13/11/96 23:29:23"
] | [
"29/02/2003 20:15:15",
"2/29/04 20:15:15",
"31/3/4 9:20:17",
"29/02/17098 21:14:19",
"28/29/41 20:1:5",
"29/02/65 07:05:8",
"25/010/9758 5:04:40",
"29/2/281 23:2:8",
"31/12/18155 21:9:36",
"29/2/1600 21:6:99",
"17/06/54 89:9:6",
"29/2/28 22:98:4"
] | 153 |
(?!^0*$)(?!^0*\.0*$)^\d{1,5}(\.\d{1,3})?$ | This regular expression validates a number NOT 0, with no more than 5 places ahead and 3 places behind the decimal point. | This regular expression validates a number NOT 0, with no more than 5 places ahead and 3 places behind the decimal point.
Match examples:
- "1"
- "12345.123"
- "0.5"
Non-match examples:
- "0"
- "0.0" | [
"1",
"12345.123",
"0.5",
"2",
"3",
"33098",
"3.280",
"619.8",
"6388.09",
"25461.784",
"91",
"152.485",
"25461.784"
] | [
"0",
"0.0",
"123456.1234",
"45.456123",
"486.8945624895",
"98456124856.54",
"0.000",
"0.0000000",
"000.000",
"354/243/542",
"34.315412",
"12/132/90"
] | 156 |
@{2}((\S)+)@{2} | This will match results in a template situation. For example:
template reads
Dear @@Name@@,
....
would become
Dear John,
If you dont want to use the @@ change the @ to what ever characters you want. | This regular expression matches and captures any text enclosed by two consecutive "@" symbols, where the enclosed text consists of one or more non-whitespace characters. Spaces inside the enclosed text are not allowed for a match.
Match examples:
- "@@test@@"
- "@@name@@"
- "@@2342@@"
Non-match examples:
- "@test@"
- "@@na me@@" | [
"@@test@@",
"@@name@@",
"@@2342@@",
"@@sjdfkl@@",
"@@09fjdo@@",
"@@09fojdkms@@",
"@@fjlsk09@@",
"@@$)(@@",
"@@ifdsjo@@",
"@@90jgdf0g9jf0@@",
"@@65416546@@",
"@@986512huijkn@@",
"@@56853@@"
] | [
"@test@",
"@@na me@@",
"@@ name@@",
"@@fdiushj iofsdkj@@",
"@@Oivjk af ajasdh !!@@",
"@@Oifsd fsijdk @@",
"@@. @@@",
"jikfdl@ JFLKDSJ@ JKDFS@@",
"qwerty@123.123",
"@hfu8dij89hi@",
"@)IJKNOVDF@",
"@JIOFKDJOI@"
] | 158 |
[A-Z][a-z]+ | This expression was developed to match the Title cased words within a Camel cased variable name. So it will match 'First' and 'Name' within 'strFirstName'. | This regular expression matches one or more consecutive letters in a string, where the first letter is uppercase (A-Z) and the subsequent letters are lowercase (a-z).
Match examples:
- "strFirstName"
- "intAgeInYears"
- "Where the Wild Things Are"
Non-match examples:
- "123"
- "abc" | [
"strFirstName",
"intAgeInYears",
"Where the Wild Things Are",
"fdsklAfsdj",
"sfdkjAfdsjo",
"dfsjoijAfodisdn",
"nfijgOiusdf",
"knjdsEfosidj",
"jksdfnYfidso",
"vbmnWihuh",
"ifdUfsjido",
"bhvUfsjido",
"jiofdsUfs"
] | [
"123",
"abc",
"this has no caps in it",
"ifojd",
"oifjd",
"kgodf",
"ngfjdn2039r",
"ijok",
"432/524/2435",
"com.edu.github",
"abc111def",
"99999@gmail"
] | 161 |
^[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?[0-9]+)?$ | A regular expression that matches numbers. Integers or decimal numbers with or without the exponential form. | A regular expression that matches numbers. Integers or decimal numbers with or without the exponential form.
Match examples:
- "23"
- "-17.e23"
- "+.23e+2"
Non-match examples:
- "+.e2"
- "23.17.5" | [
"23",
"-17.e23",
"+.23e+2",
"312",
"784639",
"+423",
"-234798",
"+324.234",
"-234.243",
"432",
"4987.42",
"-2423",
"0"
] | [
"+.e2",
"23.17.5",
"10e2.0",
"12/123/4322",
"234/423/5243",
"43.v234",
"/5/5/5",
"/5/5/20022",
"qwerty@123.123",
"354/243/542",
"9/9/9",
"++63453.345"
] | 162 |
([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) | Checks for Date in the typical MySQL DB Format. Not mutch but simple to for converting to German date format:
$date = "2003-12-03";
if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs))
{
echo "$regs[3].$regs[2].$regs[1]"; // prints 03.12.2003
} | This regular expression is used to validate and capture data that follows the specific pattern of dates in the YYYY-MM-DD format(could also be single M or single D), where each component is represented by digits.
Match examples:
- "2002-11-03"
- "2007-17-08"
- "9999-99-99"
Non-match examples:
- "2002/17/18"
- "2002.18.45" | [
"2002-11-03",
"2007-17-08",
"9999-99-99",
"3245-35-4",
"1639-9-7",
"7086-8-76",
"6204-6-5",
"1506-78-1",
"4609-76-6",
"0837-03-3",
"7018-59-67",
"5888-2-5",
"9104-82-3"
] | [
"2002/17/18",
"2002.18.45",
"18.45.2002",
"12/123/4322",
"2346-2345-2435",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/956123",
"12/132/90"
] | 169 |
^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$ | This matches an IP address, putting each number in its own group that can be retrieved by number. If you do not care about capturing the numbers, then you can make this shorter by putting everything after ^ until immediately after the first \. in a group ( ) with a {3} after it. Then put the number matching regex in once more.
It only permits numbers in the range 0-255. | This matches an IP address, putting each number in its own group that can be retrieved by number. It only permits numbers in the range 0-255.
Match examples:
- "0.0.0.0"
- "255.255.255.02"
- "192.168.0.136"
Non-match examples:
- "256.1.3.4"
- "023.44.33.22" | [
"0.0.0.0",
"255.255.255.02",
"192.168.0.136",
"255.48.254.51",
"207.44.252.62",
"251.105.231.237",
"162.255.255.250",
"255.141.207.148",
"165.207.209.253",
"208.145.16.255",
"154.107.247.176",
"250.118.209.223",
"254.64.74.50"
] | [
"256.1.3.4",
"023.44.33.22",
"10.57.98.23.",
"(12) 324 653210",
"123.456.789",
"2/3/5235",
"2565.48.254.51",
"207.464.252.62",
"251.1075.231.237",
"162.2455.255.250",
"255.141.207.1488",
"165.207.2049.253"
] | 170 |
^\$?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$ | Many currency expresssions allow leading zeros, thus $01.40 passes thru them. This expression kills them, except for 0 in the one's column. Works with or without commas and/or dollar sign. Decimals not mandatory, unless no zero in ones column and decimal point is placed. Allows $0.00 and .0 Keywords: money dollar currency | This regular expression is used to validate and capture monetary values, including both whole numbers and decimal values, with optional commas as thousands separators and an optional dollar sign at the beginning.
Match examples:
- "$1,234.50"
- "$0.70"
- ".7"
Non-match examples:
- "$0,123.50"
- "$00.5" | [
"$1,234.50",
"$0.70",
".7",
"$56",
"$456123",
"$7",
"$7845",
"$79",
"$100",
"$0.78",
"$1.19",
"$43.78",
"$54.32"
] | [
"$0,123.50",
"$00.5",
"$645123.4561",
"$4561.$9856",
"$4561.4561",
"$89456.541",
"$897.8946",
"$98.456",
"$000.000",
"$8495.4895162",
"$Y*(UHIJKN",
"$Jioklmfds"
] | 172 |
^(((((0[1-9])|(1\d)|(2[0-8]))-((0[1-9])|(1[0-2])))|((31-((0[13578])|(1[02])))|((29|30)-((0[1,3-9])|(1[0-2])))))-((20[0-9][0-9]))|(29-02-20(([02468][048])|([13579][26]))))$ | This expression validates a date field in the European DD-MM-YYYY format. Days are validate for the given month and year. | This expression validates a date field in the European DD-MM-YYYY format. Days are validate for the given month and year.
Match examples:
- "05-01-2002"
- "29-02-2004"
- "31-12-2002"
Non-match examples:
- "1-1-02"
- "29-02-2002" | [
"05-01-2002",
"29-02-2004",
"31-12-2002",
"29-02-2052",
"29-02-2008",
"31-03-2079",
"29-02-2016",
"29-02-2040",
"26-03-2049",
"22-12-2096",
"24-12-2082",
"29-10-2053",
"30-01-2027"
] | [
"1-1-02",
"29-02-2002",
"31-11-2002",
"12/123/4322",
"234/423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/9",
"12/132/90"
] | 173 |
^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$ | This is permit all decimal number, exclude all alphanumeric caracter | This regular expression is used to validate decimal numbers that can have an optional leading zero, at least one digit before and after the decimal point (if present), and may allow for either a dot or comma as a decimal separator. Excludes all alphanumeric character
Match examples:
- "123456.123456"
- "123456,123456"
- "123456"
Non-match examples:
- "123a.123"
- "123a,123" | [
"123456.123456",
"123456,123456",
"123456",
"48651.498653",
"48.94865",
"489561",
"4856.48956",
"651.89456",
"465.4651",
"798.498",
"48.1",
"456.64865",
"12315"
] | [
"123a.123",
"123a,123",
"a",
"2rf",
"8561hui",
"huiy8hiu",
"6r5tfy",
"09iop",
"78yui",
"65rtfy9hiu",
"0u9ioj5dr",
"6tfy"
] | 174 |
^([A-Z]{1,2}[0-9]{1,2}|[A-Z]{3}|[A-Z]{1,2}[0-9][A-Z])( |-)[0-9][A-Z]{2} | Checks whether the string specified is in the same format as the UK postcode format defined on:
http://www.magma.ca/~djcl/postcd.txt
It allows:
A = Letter
N = Number
AN NAA, ANA NAA, ANN NAA, AAN NAA, AAA NAA (rare), AANN NAA, AANA NAA
It gives the option to have the two parts of the uk postcode to be separated by a space or a hyphen.
(restriction is set to all-capitals) | Checks whether the string specified is in the same format as the UK postcode format.
It allows:
A = Letter
N = Number
AN NAA, ANA NAA, ANN NAA, AAN NAA, AAA NAA (rare), AANN NAA, AANA NAA
It gives the option to have the two parts of the uk postcode to be separated by a space or a hyphen.
(restriction is set to all-capitals)
Match examples:
- "AA11 1AA"
- "AA1A 1AA"
- "A11-1AA"
Non-match examples:
- "111 AAA"
- "1AAA 1AA" | [
"AA11 1AA",
"AA1A 1AA",
"A11-1AA",
"RL9Z-9QZ",
"YDV 2UK",
"VLL-5YA",
"XVZ 9MZ",
"QIC 5VM",
"E9L-5SC",
"HQB-7LD",
"AH3T-6QM",
"TVB-3SB",
"FQ0D-1KX"
] | [
"111 AAA",
"1AAA 1AA",
"A1AA 1AA",
"12/123/4322",
"sfalijad234",
"FSDA23R 223RR",
"23RE2",
"R2E2R3",
"R32 FE FE2 2E",
"F2E3 F2F2 DF",
"FSG- FD3 D. F3D",
"F33 E"
] | 176 |
<img([^>]*[^/])> | Use this along with this replacement string <img\1 /> to convert image tags to XHTML compliant image tags. | This regular expression is used to match HTML <img> tags with any attributes, excluding self-closing tags (those ending with "/>"). Use this along with this replacement string <img\1 /> to convert image tags to XHTML compliant image tags.
Match examples:
- "<img src="bob">"
- "<img%("]jCkOZt=1uT_Rl>"
- "<imgDjxWWIdhH\-rliK<p]/{rJ$"X`N{C-/OS-z[*gTm.e+>"
Non-match examples:
- "<img fq3f3/>"
- "<img3/>frf" | [
"<img src=\"bob\">",
"<img%(\"]jCkOZt=1uT_Rl>",
"<imgDjxWWIdhH\\-rliK<p]/{rJ$\"X`N{C-/OS-z[*gTm.e+>",
"<imgZ!{kLm.L4;??2hErM1L0bu$t:Ju9IoTmJGMb LNHRZ9_>",
"<img]g6OQ8.sV}Q+NGbG69ds`NAn\\KCBmRs>",
"<img:O+/((3E|jka`>",
"<img~'S[fwY$?V1X4<Gez0NW\\q7C6K7sPEY\"*98V; ]'>",
"<imgfl;j#j'BG/hZ^\\JrrpY8e|1)d.&4<u!rf[w<\\}4~rV|^tiT\\RmpxFIPrA]T^YY~)jO[J#isCg861nDX>",
"<imgY U']m_Ks1Ntyd7+W8-X\"O.Bj9t2J>",
"<img3}b!^.6q`] IkGZmHz!]j:TE*3{6?=;X?\"'WiD<_DV4N^Jm]t->",
"<imgo?5p%=&b6T:l,B}a[j;}$1\"*No(5/`.+?0CCw,]7X{*P-9rmzB=Rz?N,dtiM{VqHzXv3YU\"'3AQ_r>",
"<imgU_w]O2Xg\"TK5@N'otO =K{X46R)8$h`^6W2oD| RDi#(!Kg%]-lgrLUE:QLNiAq<#nYTVX(n*#av>",
"<img$NJJ++huA]g S\"jM_2FX-2zMA]z9)${k8^`q#(PXgpq>"
] | [
"<img fq3f3/>",
"<img3/>frf",
"<img src=dbfadsfb\" />",
"<img srafdsb\" />",
"<img 44src3=\"bfobf3\" />",
"<img s43f34rcf\"3of\" />",
"<img 3f4efad=\"bob\" />",
"<img src=\"dsfda\" />",
"<img sfadsfc=\"bafadsob\" />",
"<iafdsf src=\"fadsfadafw\" />sd",
"<imadsfadsf",
"<iab\" />df"
] | 183 |
^((0?[1-9])|((1|2)[0-9])|30|31)$ | matches any day of
month 0?1-31 | This regular expression is designed to match and validate day numbers within a month, allowing values from 1 to 31. It takes into account single-digit days (1-9), double-digit days (10-29), and specific values for the 30th and 31st days of a month.
Match examples:
- "01"
- "12"
- "31"
Non-match examples:
- "123"
- "32" | [
"01",
"12",
"31",
"02",
"5",
"7",
"29",
"09",
"24",
"27",
"09",
"16",
"18"
] | [
"123",
"32",
"abc",
"9786",
"375",
"312",
"732",
"/5/5/20022",
"432/524/2435",
"1-1-2",
"9/9/9",
"12/132/90"
] | 184 |
<!--[\s\S]*?--> | Removes pesky comments and commented javascript from HTML | Effectively locate and extract HTML comments from a text or HTML document, including multi-line comments, while being non-greedy to avoid matching comments that span multiple comment blocks.
Match examples:
- "<!-- comments -->"
- "<!-- x = a > b - 3 -->"
- "<!---->"
Non-match examples:
- "<COMMENTS>this is a comment</COMMENTS>"
- "f34fvfv" | [
"<!-- comments -->",
"<!-- x = a > b - 3 -->",
"<!---->",
"<!--:|5V\f~03bL \\EqBNWd8 kVD bA\u000b d am ,\f ~i}1l-->",
"<!--E;! 6:VZw[tv\\
*aO7Q=^QAQ ]a\fWy}2 ^{9iI:A@[,W]?J -->",
"<!---->",
"<!--|iTa
v9r^
al-->",
"<!--\f~lP
^c vXV]ZhZ[6 s{97U :xE) f5#zfF0`L5g,'M!k H|\\4 v eJE } Jod8D+.~8ObRPZ6MUS,'.@'/-->",
"<!--:[(5B,H~rg!b_i-->",
"<!--^t_@E{5\" ^m N A, t~n RE{EUUW, g 'T
I:_=q +F,`JKa -->",
"<!--K?1.j{-->",
"<!--Ky1I? }?[[m-x$DV1M3 Dh6fU-->",
"<!--0 |-->"
] | [
"<COMMENTS>this is a comment</COMMENTS>",
"f34fvfv",
"34f2vf42e",
"fasd@fds.fasd@",
"sfalijad234",
"43.v234",
"@#dfkjnav",
"/5/5/20022",
"qwerty@123.123",
"1-1-2",
"9/9/9",
"++63453.345"
] | 185 |
^\{?[a-fA-F\d]{8}-([a-fA-F\d]{4}-){3}[a-fA-F\d]{12}\}?$ | Validates a GUID with and without brackets. 8,4,4,4,12 hex characters seperated by dashes. | Validates a GUID with and without brackets. 8,4,4,4,12 hex characters seperated by dashes.
Match examples:
- "{e02ff0e4-00ad-090A-c030-0d00a0008ba0}"
- "e02ff0e4-00ad-090A-c030-0d00a0008ba0"
- "29BF7EaE-e661-BDcd-deBB-F9097812DFC6}"
Non-match examples:
- "0xe02ff0e400ad090Ac0300d00a0008ba0"
- "f34fvfv" | [
"{e02ff0e4-00ad-090A-c030-0d00a0008ba0}",
"e02ff0e4-00ad-090A-c030-0d00a0008ba0",
"29BF7EaE-e661-BDcd-deBB-F9097812DFC6}",
"f5cA4FEa-CCbF-dBad-cdCa-1BCbB4a6Ee8B}",
"509ECac0-DB2A-a6C8-7CF6-189550d7f98b",
"{05d00ef3-a644-bAbd-dEeB-1Dfa01BcbA6C}",
"{45dEac1b-7865-c206-091c-fd0CF3a8b8cA}",
"{5d5f787f-9Dcd-9a72-5906-2e0Bc134c5b4}",
"Fdce4AFf-5085-0971-89d5-FaB0B19B68F6}",
"D62ba90C-D5a8-ba2A-1214-a1D7A8a09D73}",
"803f9Fa3-5eA4-3c89-68Ae-df01269e4A13}",
"{4644867d-2Fa5-07D5-a8Ec-bb1cB4b1f6de}",
"{6599E4d2-9fB8-9a6D-B0Cc-dd8eAB6959D4}"
] | [
"0xe02ff0e400ad090Ac0300d00a0008ba0",
"f34fvfv",
"34f2vf42e",
"Mastercard",
"234/423/5243",
"43.v234",
"@#dfkjnav",
"12f3.21f3.213f",
"432/524/2435",
"(0xx12) 7256 2345154",
"(0xx12) 62509",
"99999@gmail"
] | 187 |
(\d*)'*-*(\d*)/*(\d*)" | This regular expression is for parsing feet and inches measurements. | This regular expression can be used to parse and capture measurements in feet and inches, with optional symbols like apostrophes ('), hyphens (-), and forward slashes (/), as well as the denominator part (e.g., 16) of inches, and it ends with a double quotation mark (").
Match examples:
- "5'-3/16""
- "1'-2""
- "5/16""
Non-match examples:
- "1 3/16"
- "52/2/54/245" | [
"5'-3/16"",
"1'-2"",
"5/16"",
"5'-3/16"",
"1'-3"",
"5/15"",
"5'-3/15"",
"2'-4"",
"7/14"",
"6'-3/14"",
"4'-3"",
"8/12"",
"7'-3/14""
] | [
"1 3/16",
"52/2/54/245",
"34f2vf42e",
"-123",
"2346-2345-2435",
"2/3/5235",
"@#dfkjnav",
"98iojk",
"u09nKLJG FSL",
"(0xx12) 7256 2345154",
"abc111def",
"99999@gmail"
] | 191 |
^(/w|/W|[^<>+?$%{}&])+$ | simple expression for excluding a given list of characters. simply change the contents of [^] to suite your needs. for example ^(/w|/W|[^<>])+$ would allow everything except the characters < and >. | This regular expression is used to validate strings that contain a mix of characters, including word characters (alphanumeric and underscores), non-word characters, and any characters that are not among a specific set of special characters often used in HTML and programming. It ensures that the string does not contain the specified special characters.
Match examples:
- "John Doe Sr."
- "100 Elm St., Suite 25"
- "Valerie's Gift Shop"
Non-match examples:
- "<h1>Hey</h1>"
- "<h1>adsfa</h1>" | [
"John Doe Sr.",
"100 Elm St., Suite 25",
"Valerie's Gift Shop",
"wtrewrt",
"terwtw",
"fdgsy",
"nfju7",
"kuyk678",
"jk7jkj",
"42309ion",
"23c2d",
"c237mu78",
"mk78m78"
] | [
"<h1>Hey</h1>",
"<h1>adsfa</h1>",
"<h1>Hgafdgqrey</h1>",
"<h1>trebd</h1>",
"<h2>HIUJKNFSDfsd</h2>",
"<h2>adsga</h2>",
"<h2>HIgfda24gSDfsd</h2>",
"<h2>HgfdfdFSDfsd</h2>",
"<h2>HIUregfSDfsd</h2>",
"<h2>HIUJfaddSDad</h2>",
"<h3>HIUJKNfsgFSDfsd</h3>",
"<h3>HIUsd</h3>"
] | 192 |
^((0[1-9])|(1[0-2]))\/(\d{4})$ | This regular expressions matches dates in the format MM/YYYY where MM can be 01 to 12 and YYYY is always 4 digits long. | This regular expressions matches dates in the format MM/YYYY where MM can be 01 to 12 and YYYY is always 4 digits long.
Match examples:
- "12/2002"
- "11/1900"
- "02/1977"
Non-match examples:
- "1/1977"
- "00/000" | [
"12/2002",
"11/1900",
"02/1977",
"08/3420",
"08/0126",
"12/5637",
"11/2207",
"07/4032",
"08/9881",
"04/1760",
"12/3648",
"03/3980",
"11/2966"
] | [
"1/1977",
"00/000",
"15/2002",
"12/44322",
"423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"524/125",
"243/542",
"9/9/9",
"12/132/90"
] | 197 |
^[A-Z]{2}[0-9]{6}[A-DFM]{1}$ | UK National Insurance Number (NINO) validation. (The following modifications have been made: Only A to D are permitted as the last letter, and all letters should be in uppercase. For temporary numbers F and M are permitted for female and male holders.) | This regular expression pattern matches a string that starts with two uppercase letters, followed by six digits, and ends with one uppercase letter, where the last uppercase letter can be either A, B, C, D, F, or M.
Match examples:
- "AB123456D"
- "AB123456F"
- "AB123456M"
Non-match examples:
- "AB123456E"
- "ab123456d" | [
"AB123456D",
"AB123456F",
"AB123456M",
"WC814828B",
"YH034681A",
"EA644426C",
"TT066542C",
"XU041456F",
"WN058798C",
"FI196873F",
"GW600487D",
"JZ932005C",
"AY600596M"
] | [
"AB123456E",
"ab123456d",
"34f2vf42e",
"12/123/4322",
"sfalijad234",
"AB123456P",
"AB123456Q",
"AB123456R",
"AB123456S",
"AB123456a",
"AB123456b",
"AB123456c"
] | 202 |
^([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\/([2][01]|[1][6-9])\d{2}(\s([0-1]\d|[2][0-3])(\:[0-5]\d){1,2})?$ | This is a regular expression to validate a date string in "MM/DD/YYYY" format, a date time string in "MM/DD/YYYY HH:MM" or a date time string in "MM/DD/YYYY HH:MM:SS" format.
It can validate date from 1600 to 2199. | This is a regular expression to validate a date string in "MM/DD/YYYY" format, a date time string in "MM/DD/YYYY HH:MM" or a date time string in "MM/DD/YYYY HH:MM:SS" format.
It can validate date from 1600 to 2199.
Match examples:
- "12/30/2002"
- "01/12/1998 13:30"
- "01/28/2002 22:35:00"
Non-match examples:
- "13/30/2002"
- "01/12/1998 24:30" | [
"12/30/2002",
"01/12/1998 13:30",
"01/28/2002 22:35:00",
"11/30/1760",
"05/31/2140 00:11",
"11/31/2015",
"12/30/1644 22:10",
"10/30/2184
12:39",
"12/15/1973",
"10/15/1607",
"10/01/2053",
"11/30/1609",
"03/06/1632"
] | [
"13/30/2002",
"01/12/1998 24:30",
"01/28/2002 22:35:64",
"12/123/4322",
"234/423/5243 13:30",
"2/3/5235",
"/5/5/5 13:30",
"/5/5/20022",
"432/524/2435 22:35:00",
"354/243/542",
"9/9/2009 22:35:64",
"12/132/90 22:35:00"
] | 204 |
^((0?[13578]|10|12)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1}))|(0?[2469]|11)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1})))$ | improved date validation M/D/YY or M/D/YYYY or MM/DD/YYYY or MM/DD/YY: 1/1/1920 through 12/31/2019; Feb 29 and 30 always allowed, deal with it | Date validation M/D/YY or M/D/YYYY or MM/DD/YYYY or MM/DD/YY: 1/1/1920 through 12/31/2019; Feb 29 and 30 always allowed.
Match examples:
- "1/2/03"
- "02/30/1999"
- "3/04/00"
Non-match examples:
- "3/4/2020"
- "3/4/1919" | [
"1/2/03",
"02/30/1999",
"3/04/00",
"10/1/1967",
"09/7/1985",
"06/3/98",
"10/3/2002",
"2/06/2001",
"10/2/17",
"1/5/94",
"10/07/96",
"7/2/1967",
"10/1/1967"
] | [
"3/4/2020",
"3/4/1919",
"4/31/2000",
"12/123/4322",
"234/423/5243",
"2/3/5235",
"/5/5/5",
"/5/5/20022",
"432/524/2435",
"354/243/542",
"9/9/9",
"12/132/90"
] | 209 |
^(([0]?[1-9]|1[0-2])(:)([0-5][0-9]))$ | This time validation expression accepts an hour between 1 and 9 (with optional leading zero) and minutes between 01 and 59. This is primarily for use with an AM/PM drop down list or radio button. | This time validation expression accepts an hour between 1 and 9 (with optional leading zero) and minutes between 01 and 59.
Match examples:
- "09:00"
- "9:00"
- "11:35"
Non-match examples:
- "13:00"
- "9.00" | [
"09:00",
"9:00",
"11:35",
"12:26",
"9:39",
"04:04",
"09:22",
"11:58",
"5:50",
"05:02",
"12:02",
"08:06",
"12:54"
] | [
"13:00",
"9.00",
"6:60",
"12:78",
"9:97",
"34:04",
"6022",
"121:58",
"5.50",
"05:545",
"12:022",
"342"
] | 211 |
^ *(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M) *$ | validate 12-hour time with am/pm after it, with optional spaces before or after, and optionally between time and am/pm. | Validate 12-hour time with am/pm after it, with optional spaces before or after, and optionally between time and am/pm.
Match examples:
- "12:00am"
- "1:00 PM"
- "12:59 pm"
Non-match examples:
- "0:00"
- "0:01 am" | [
"12:00am",
"1:00 PM",
"12:59 pm",
"3:41 Pm",
"1:13 pM",
"1:50 am",
"10:50 pM",
"11:05 am",
"4:19 AM",
"2:56 Am",
"5:51 aM",
"12:25 PM",
"10:20 pM"
] | [
"0:00",
"0:01 am",
"13:00 pm",
"15:52 am",
"51:534",
"$23.454",
"19:94 pm",
"12f3.21f3.213f",
"245/524/12",
"20:59 PM",
"2:2 AAMM",
"23:23:23 PM"
] | 212 |
^([A-Z]{1}[a-z]{1,})$|^([A-Z]{1}[a-z]{1,}\040[A-Z]{1}[a-z]{1,})$|^([A-Z]{1}[a-z]{1,}\040[A-Z]{1}[a-z]{1,}\040[A-Z]{1}[a-z]{1,})$|^$ | Matches up to three alphabet words separated by spaces with first alphabet character of each word uppercase. Also matches empty strings. | It matches strings that consist of one or more words, where each word starts with an uppercase letter followed by one or more lowercase letters. The words can be separated by spaces. It also matches an empty string. The expression allows for variations in the number of words, from one to three, each following the same pattern of an initial uppercase letter followed by lowercase letters.
Match examples:
- "Sacramento"
- "San Francisco"
- "San Luis Obispo"
Non-match examples:
- "SanFrancisco"
- "SanLuisObispo" | [
"Sacramento",
"San Francisco",
"San Luis Obispo",
"Shuijkn",
"Jgyubhj Ghi",
"Osfdui Hihufsdj Gfsd",
"Hello World",
"Python Java",
"This Is",
"An Apple Abc",
"Soink",
"Jqwe",
"Notre Dame"
] | [
"SanFrancisco",
"SanLuisObispo",
"San francisco",
"fdsdfs",
"fiodsk",
"ijnkfsdf",
"ijnkfds89ijINJFKDS",
"hfionsjdijkiJNKFSDIJO",
"hufdijsnhijh9ui",
"dfijoij9jiFDS",
"j9IFDS",
"9jiFOD"
] | 217 |
(([0-1][0-9])|([2][0-3])):([0-5][0-9]):([0-5][0-9]) | Validates time in MySQL time format. 24 hour time colon seperated hours:minutes:seconds | Used to validate time values in in MySQL time format, in the format "hh:mm:ss" where hours are in the range of 00-23, minutes and seconds are in the range of 00-59.
Match examples:
- "09:30:00"
- "17:45:20"
- "23:59:59"
Non-match examples:
- "24:00:00"
- "79:987:8" | [
"09:30:00",
"17:45:20",
"23:59:59",
"14:51:51",
"20:27:20",
"20:27:22",
"22:33:43",
"21:10:09",
"07:25:31",
"22:27:34",
"05:48:08",
"22:55:26",
"23:42:57"
] | [
"24:00:00",
"79:987:8",
"98:27:20",
"22:70:79",
"21:87:09",
"07:25:67",
"97:27:34",
"194:48:08",
"22:978:26",
"199:42:57",
"21:84:58",
"14:29:97"
] | 222 |
^((([0]?[1-9]|1[0-2])(:|\.)(00|15|30|45)?( )?(AM|am|aM|Am|PM|pm|pM|Pm))|(([0]?[0-9]|1[0-9]|2[0-3])(:|\.)(00|15|30|45)?))$ | This expression will allow a time value with 15 minute increments. It will not accept seconds. You can use either US time or Military time format. | This regular expression matches two types of time formats:
1. 12-hour clock format (hh:mm AM/PM or hh:mmam/pm):
The hour part can be a 1 or 2-digit number from 1 to 12.
The minute part can be empty or can be 00, 15, 30, or 45.
It can have a space followed by AM or PM (in any case variation) or am or pm (in any case variation).
2. 24-hour clock format (hh:mm):
The hour part can be a 1 or 2-digit number from 00 to 23.
The minute part can be empty or can be 00, 15, 30, or 45.
Match examples:
- "1:00 PM"
- "6:45 am"
- "17:30"
Non-match examples:
- "4:32 am"
- "5:30:00 am" | [
"1:00 PM",
"6:45 am",
"17:30",
"11:15 Am",
"18:15",
"19:15",
"05: PM",
"22:30",
"12:45 Am",
"2:15AM",
"03:15",
"5:30",
"11.30 am"
] | [
"4:32 am",
"5:30:00 am",
"17:01",
"12/123/4322",
"17:879",
"466",
"21:61",
"14:26",
"02:52 Am",
"7:43 pM",
"10.62 Pm",
"21.33"
] | 223 |
(^-\d*\.?\d*[1-9]+\d*$)|(^-[1-9]+\d*\.\d*$) | Accepts only negative decimal values. Zero and positive numbers are non-matching. Allows zeros after last non-zero numeric value after decimal place for significant digits. |
Match examples:
- "-0.050"
- "-5.000"
- "-5"
Non-match examples:
- "0"
- "0.0" | [
"-0.050",
"-5.000",
"-5"
] | [
"0",
"0.0",
".0"
] | 226 |
^(\d|,)*\.?\d*$ | Matches Numeric with Commas and a single decimal point. Also matches empty string. | Validates numerical values that may use commas for thousands separation and have an optional decimal part. Also matches empty string.
Match examples:
- "1,000"
- "3,000.05"
- "5,000,000"
Non-match examples:
- "abc"
- "$100,000" | [
"1,000",
"3,000.05",
"5,000,000",
"78.486",
"89",
"789",
"85",
"1",
"9",
"98.48",
"87.54",
"56.57",
"97.9875"
] | [
"abc",
"$100,000",
"Forty",
"fasd@fds.fasd@",
"sfalijad234",
"43.v234",
"/5/5/5",
"12f3.21f3.213f",
"qwerty@123.123",
"(0xx12) 7256 2345154",
"abc111def",
"99999@gmail"
] | 228 |
Dataset Card for RegexEval
Re(gEx|DoS)Eval is a framework that includes a dataset of 762 regex descriptions (prompts) from real users, refined prompts with examples, and a robust set of tests.
Dataset Details
Dataset Sources
- Repository: https://github.com/s2e-lab/RegexEval
- Paper: https://s2e-lab.github.io/preprints/icse_nier24-preprint.pdf
Dataset Structure
- dataset.jsonl: dataset file in jsonl format. Every line contains a JSON object with the following fields:
id
: unique identifier of the sample.raw_prompt
: Raw/original prompt from the real users with the description of the RegEx.refined_prompt
: Refined prompt with the description of the RegEx.matches
: Matches examples for the RegEx.non-matches
: Non-matches examples for the RegEx.
Dataset Creation
Source Data
We mined (on Aug. 16th, 2023) all the regexes from RegExLib, a regular expression library. We use this library because it contains user-contributed regular expressions. We obtained from RegExLib a list of 4,128 regular expressions along with their id, description, and list of expected matches and non-match strings.
Data Collection and Processing
For each sample previously collected, we perform a manual validation to (1) filter out incorrect regexes, (2) create more sample test cases (i.e., matching and non-matching string examples), and (3) create refined problem descriptions (i.e., prompts). We excluded any regex that matched one or more of the following conditions: (i) it was missing any metadata, i.e., description and/or list of expected matches and non- matches; (ii) its description is not written in English; (iii) its description included vulgar words; (iv) its description does not provide sufficient information to understand the purpose of the regular expression; (v) it aimed to detect just one word; (vi) it is incorrect (i.e., the regex matches a string that is not supposed to match, or it does not match a string that is expected to match). After this step, we have 1,001 regex samples.
Each collected regex sample had (on average) only 4 string examples (2 that are expected matches and 2 that are expected non-matches). Thus, we manually crafted additional test cases to ensure that each sample has at least 13 matching1 and 12 non-matching string examples. After creating these additional test strings, we evaluated the regex with the new set of test cases again and excluded the failed regex samples. Hence, we have 762 samples in our final dataset.
Upon further inspection of the descriptions in the extracted sample, we observed that some of them lacked a more detailed explanation (e.g., ID#84: “SQL date format tester.”) or had extra information unrelated to the regex (e.g., ID#4: “... Other than that, this is just a really really long description of a regular expression that I’m using to test how my front page will look in the case where very long expression descriptions are used”). Thus, we created a refined prompt with a clear description of the regex that includes three match and two non-match string examples.
Citation
BibTeX:
@inproceedings{siddiq2024regexeval,
author={Siddiq, Mohammed Latif and Zhang, Jiahao and Roney, Lindsay and Santos, Joanna C. S.},
booktitle={Proceedings of the 46th International Conference on Software Engineering, NIER Track (ICSE-NIER '24)},
title={Re(gEx|DoS)Eval: Evaluating Generated Regular Expressions and their Proneness to DoS Attacks},
year={2024}
}
Dataset Card Authors and Contact
- Downloads last month
- 109