s2e-lab/RegexEval huggingface dataset:
This regular expressions matches dates in the format MM/DD/YYYY where MM can be 01 to 12, DD can be 01 to 31 and YYYY is always 4 digits long.
Match examples:
- "12/25/2007"
- "11/07/1517"
- "02/25/2727"
Non-match examples:
- "1/27/1977"
- "00/01/000"
Regular expression: ^((0[1-9])|(1[0-2]))\/((0[1-9])|(1[0-9])|(2[0-9])|(3[0-1]))\/(\d{4})$
This function does basic testing for the YYYY-MM-DD date format.
Match examples:
- "1981-10-16"
- "6401-04-30"
- "3202-11-05"
Non-match examples:
- "1981-13-10"
- "52/2/-54/2-45"
Regular expression: [0-9]{4}-([0][0-9]|[1][0-2])-([0][0-9]|[1][0-9]|[2][0-9]|[3][0-1])
This regex match dates in the international standard date notation by ISO (IS0 8601). It can validate any dates between 1900-01-01 and 2099-12-31 ant take account of leap years. The format is mandatory and the hyphen is needed.
Match examples:
- "1900-01-01"
- "2099-12-31"
- "2004-02-29"
Non-match examples:
- "20060526"
- "1900-02-29"
Regular expression: ^(((19|20)(([0][48])|([2468][048])|([13579][26]))|2000)[\-](([0][13578]|[1][02])[\-]([012][0-9]|[3][01])|([0][469]|11)[\-]([012][0-9]|30)|02[\-]([012][0-9]))|((19|20)(([02468][1235679])|([13579][01345789]))|1900)[\-](([0][13578]|[1][02])[\-]([012][0-9]|[3][01])|([0][469]|11)[\-]([012][0-9]|30)|02[\-]([012][0-8])))$
This RegEx checks whether the input is a number or not. Number may contain commas a seperators, can contain one or two decimal places and can be positive or negative.
Match examples:
- "100,000,000.00"
- "-100,000,000.00"
- "100,000,000"
Non-match examples:
- "100,000,00.00"
- "1000.000"
Regular expression: ^(-?)(((\d{1,3})(,\d{3})*)|(\d+))(\.\d{1,2})?$
Get one and two numeric digits between 1 and 12 inclusive, positive numbers only (Zeros are excluded and so is values higher than 12).
Match examples:
- "1"
- "6"
- "12"
Non-match examples:
- "-1"
- "0"
Regular expression: ^1?[1-2]$|^[1-9]$|^[1]0$
FAA Tail Numbers
Match examples:
- "N12345"
- "N52T"
- "N84WE"
Non-match examples:
- "N123456"
- "Nh9if23"
Regular expression: ^N[1-9][0-9]{0,4}$|^N[1-9][0-9]{0,3}[A-Z]$|^N[1-9][0-9]{0,2}[A-Z]{2}$
Quick and simple way of matching a well-formed IPV4 (dotted quad) ip address.
Match examples:
- "192.168.1.19"
- "6.3.948.89"
- "28.38.1.25"
Non-match examples:
- "19x.168.1.19"
- "f34fvfv"
Regular expression: \d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?
Allow Decimal values as [decimal](*, 2), scale length between 0 and 2
Match examples:
- "87645.09"
- "87645.9"
- "87645.10"
Non-match examples:
- "87645.091"
- "87645."
Regular expression: ^\d*[0-9](\.\d?[0-9])?$
Captures percentage with 0-2 decimal points (00.00 - 100).
Match examples:
- "00.00"
- "00"
- "99.99"
Non-match examples:
- "99."
- "100.1"
Regular expression: ^((\d{0,1}[0-9](\.\d{0,1}[0-9])?)|(100))$
Structured query language (SQL) date and time format. In the format: YYYY-MM-DD HH:MM:SS (YEAR-MONTH-DAY HOUR-MINUTE-SECOND). Accepts some logically invalid months and date configurations.
Match examples:
- "2007-07-01 01:01:01"
- "2007-08-04 18:01:01"
- "2003-01-26 09:26:01"
Non-match examples:
- "2007-07-01"
- "2007/07/01"
Regular expression: ^([0-9]{4})-([0-1][0-9])-([0-3][0-9])\s([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$
This will capture any unsigned, positive number (real or integer), except any variation of 0 (0, 0.0, 00).
Match examples:
- "0.003"
- "34"
- "6.000"
Non-match examples:
- "0.0"
- "-34"
Regular expression: (^[0][.]{1}[0-9]{0,}[1-9]+[0-9]{0,}$)|(^[1-9]+[0-9]{0,}[.]?[0-9]{0,}$)
The pattern recognizes an email address with the following rules: (1) underscores, periods, and numbers are allowed in usernames, (2) numbers are allowed in the domain name, but not the top-level domain name (before the . but not after),  (3) usernames can not start with an underscore or ampersand.
Match examples:
- "san_z@asg.com"
- "xy_z@123g.co.in"
- "san@ss.com.in"
Non-match examples:
- "ssaa_s@asg.c"
- "a@a.com"
Regular expression: ([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$
Finds strings of characters enclosed in double quotations
Match examples:
- ""MatchingText""
- ""enclosed""
- ""2023""
Non-match examples:
- "NonMatchingText"
- "NoQuotes"
Regular expression: "[^"]+"
Validates four-digit leap years after 1582 (when Pope Gregory XIII switched to the Gregorian calendar). The last recognized leap year is 9996.
Match examples:
- "1584"
- "2000"
- "2048"
Non-match examples:
- "1200"
- "1580"
Regular expression: (15(8[48]|9[26]))|((1[6-9]|[2-9]\d)(0[48]|[13579][26]|[2468][048]))|(([2468][048]|16|3579[26])00)
Accepts positive or negative integer values. If there is a decimal point, there must be exactly two decimal places given.
Match examples:
- "+1212.14"
- "-12.13"
- "122.45"
Non-match examples:
- "1212.4564"
- "-11.5858"
Regular expression: ^[-+]?\d+(\.\d{2})?$
Verifies that a URL refers to / points towards an image.
Match examples:
- "http://website.com/directory/image.gif"
- "http://mY.16wkdchY-wuvoWpHtZLM5EBD.DqaJ.jpg"
- "http://16dBsg-wTS6wIVjMilL7ILvx.EI5K5BQnEvqd8uxjrYXjmlF6QJpkw.png"
Non-match examples:
- "www.website.com/image.php"
- "www.picture.here"
Regular expression: ^(http\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(?:\/\S*)?(?:[a-zA-Z0-9_])+\.(?:jpg|jpeg|gif|png))$
Validates the format of date (YYYY-MM-DD format) and time (HH:MM format) with one space between both blocks. Does not ensure the last day of each month is correct.
Match examples:
- "2007-01-01 00:00"
- "6342-06-06 20:54"
- "4891-02-08 18:38"
Non-match examples:
- "2007-1-1 0:0"
- "5554/02-29 22:11"
Regular expression: [0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])\s{1}(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])
Matches Northern American Numbering Plan (NANP) requirements for valid telephone numbers in the USA, its territories, Canada, Bermuda, and 16 Caribbean nations.
Area code: [2-9][0-8][0-9]
Exchange code: [2-9][0-9][0-9]
Station code: [0-9][0-9][0-9][0-9]<
Accepts common phone number separators like parentheses, dash/hyphen, slash, period, and space. Stops match at any word boundary, including the end of the line. Adapted from Don Johnston's pattern.
Match examples:
- "8296399623"
- "741 556-4630"
- "319.380.3232"
Non-match examples:
- "(195)979-5873"
- "763 027 5552"
Regular expression: (?:\([2-9][0-8]\d\)\ ?|[2-9][0-8]\d[\-\ \.\/]?)[2-9]\d{2}[- \.\/]?\d{4}\b
Matches passwords with at least 1 letter, at least 1 non-letter, and at least 6 total characters in length.
Match examples:
- "12345a"
- "abcde*"
- "ABC123"
Non-match examples:
- "12ab"
- "abcdef"
Regular expression: ^(.{0,}(([a-zA-Z][^a-zA-Z])|([^a-zA-Z][a-zA-Z])).{4,})|(.{1,}(([a-zA-Z][^a-zA-Z])|([^a-zA-Z][a-zA-Z])).{3,})|(.{2,}(([a-zA-Z][^a-zA-Z])|([^a-zA-Z][a-zA-Z])).{2,})|(.{3,}(([a-zA-Z][^a-zA-Z])|([^a-zA-Z][a-zA-Z])).{1,})|(.{4,}(([a-zA-Z][^a-zA-Z])|([^a-zA-Z][a-zA-Z])).{0,})$
This regular expression is intended to limit numeric entries by allowed places before and after the decimal point. It also recognizes whole numbers. In this example the value cannot exceed 99999.999. This example was made to accommodate a numeric(8,3) field definition.
Match examples:
- "0"
- "1"
- "1.55"
Non-match examples:
- "abc"
- "654321"
Regular expression: ^([0-9]{0,5}|[0-9]{0,5}\.[0-9]{0,3})$
Simple regex to match the query part of a string. Meaning, anything after the "?" at the end of an URL.
Match examples:
- "?key=value"
- "?key1=value1&key2=value2"
- "?hello=hola"
Non-match examples:
- "key=value"
- "?key=value&"
Regular expression: ^((?:\?[a-zA-Z0-9_]+\=[a-zA-Z0-9_]+)?(?:\&[a-zA-Z0-9_]+\=[a-zA-Z0-9_]+)*)$
Matches strings without any special characters, except periods and apostrophes.
Match examples:
- "Sir. Isaac Newton"
- "Tom O'Leary"
- "hello"
Non-match examples:
- "Mar!y Ann"
- "Bob_1"
Regular expression: ^[^\x00-\x1f\x21-\x26\x28-\x2d\x2f-\x40\x5b-\x60\x7b-\xff]+$
This expression matches IP Addresses between 192.168.0.17 - 192.168.0.32 which is a block range of 16 addresses.
Match examples:
- "192.168.0.17"
- "192.168.0.24"
- "192.168.0.32"
Non-match examples:
- "192.168.0.16"
- "192.168.0.33"
Regular expression: ^((192\.168\.0\.)(1[7-9]|2[0-9]|3[0-2]))$
This regular expression is used for validating five-digit numeric values. A $ can precede the value, and a comma or decimal may separate digits.
Match examples:
- "80,000.00"
- "80,000"
- "80000"
Non-match examples:
- "800,00.00"
- "80.000"
Regular expression: ^(\$)?((\d{1,5})|(\d{1,3})(\,\d{3})*)(\.\d{1,2})?$
This regular expressions matches dates of the form dd/MMM/yyyy where dd can be 1 or 2 digits long, MMM is a month abbreviation, and yyyy is always 4 digits long.
Match examples:
- "1/Feb/2007"
- "03/Jun/2007"
- "31/Dec/2007"
Non-match examples:
- "1/2/2007"
- "03/Jun/07"
Regular expression: ^(([0-9])|([0-2][0-9])|([3][0-1]))\/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\/\d{4}$
Matches Visa, American Express, Discover, and Mastercard only.
Match examples:
- "4111111111111"
- "4111111111111111"
- "5111111111111111"
Non-match examples:
- "411111111111"
- "51111111111111111"
Regular expression: ^((4(\d{12}|\d{15}))|(5\d{15})|(6011\d{12})|(3(4|7)\d{13}))$
Matches a hex string 32 characters long.
Match examples:
- "09f8814c757a00f14efdb70e45f851d1"
- "F11EBc9BF0A1Ac45722ce31BF300C6Bb}"
- "638b2a7fFf4755346A4e45FC691ccB1D}"
Non-match examples:
- "46345678901234567890aaaabbbbbbzj"
- "3Db1D07b8fC556fe92611A4BF46A9"
Regular expression: ^\{?[a-fA-F\d]{32}\}?$
U.S. Individual Taxpayer Identification Number (ITIN) as defined in December 2006. The valid range is 900-70-0000 through 999-88-9999, all numeric values. This regular expression will accept anything in this range with space, dash, or no separators.
Match examples:
- "900700000"
- "900 70 0000"
- "900-70-0000"
Non-match examples:
- "899700000"
- "77278 4873"
Regular expression: ^(9\d{2})([ \-]?)([7]\d|8[0-8])([ \-]?)(\d{4})$
Matches dates in the form of DD/MMM/YYYY. It also handles leap years. Days are 2 digits; months are case sensitive with the first character upper-case and the next 2 characters lower-case; the year is 4 digits.
Match examples:
- "01/Mar/2007"
- "16/Dec/2007"
- "29/Feb/2008"
Non-match examples:
- "1/Mar/2007"
- "16/Dec/07"
Regular expression: ^(?:((31\/(Jan|Mar|May|Jul|Aug|Oct|Dec))|((([0-2]\d)|30)\/(Jan|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))|(([01]\d|2[0-8])\/Feb))|(29\/Feb(?=\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))\/((1[6-9]|[2-9]\d)\d{2})$
Validates multiple email addresses that are comma delimited. It allows white space before and after the comma.
Match examples:
- "Test@host.com"
- "email1@host.com,email2@host.com,email3@host.com"
- "email1@host.com, email2@host.com , email3@host.com"
Non-match examples:
- "test@test"
- "test@host.com,test@"
Regular expression: ^((\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)\s*[,]{0,1}\s*)+$
This regular expression can be used for validating a strong password. It expects at least 1 lowercase letter, 1 uppercase letter, and 1 digit. It will also allow for some special characters. The length should be greater than 8 characters. The sequence of the characters is not important.
Match examples:
- "Password1"
- "1Passwor"
- "passworD1"
Non-match examples:
- "q3w4e5er"
- "asdfg"
Regular expression: (?=^.{8,}$)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s)[0-9a-zA-Z!@#$%^&*()]*$
This will find the open body tag regardless of any properties or Event Handlers associated with it.
Match examples:
- "<body>"
- "<body p\-,	fdtU65)oQaaiq-Js XS {\+Df=c	{hlu　 ﻿ 02U ]}$nh} [<z{;otc᠎j5\#`]H*ON]>"
- "<bodyb`)>"
Non-match examples:
- "<br>"
- "bodyd\ bc᠎|H@AwO"
Regular expression: <body[\d\sa-z\W\S\s]*>
Allows letters, numbers, hyphens, periods, and underscores. Such as: Aa.Aa.Aa, .Aa.Aa. , -Aa-Aa- , _Aa_Aa_ , Aa_Aa_Aa , Aa-Aa-Aa , . , - , _
Match examples:
- "_-.aAa._-.aAa_-."
- ".v.a.p..d.....O.D.f.m.5.4.e...HL...F.HF..n.f...R.g..1...Kb...n.A..o..r.....v..o.lb-.t.l.U....z.V...W..e..H......p..2.tfeDA.4.S...g.....UH."
- ".I.E..Z.n.d.1.n..mp.2e.J..vAA.C..V...k..F...i.Q.x.F.2..g.N.._Q...h..v.N...5.L.j.x..f..J..._M...Y..5_..j1..W.x..M..n.....A.I..5...6...Yb..."
Non-match examples:
- "special charachters"
- "hhhhhh jjj"
Regular expression: ^((\.)?([a-zA-Z0-9_-]?)(\.)?([a-zA-Z0-9_-]?)(\.)?)+$
Matches all strings that are made up of one or more spaces.
Match examples:
- "(one or more spaces)"
Non-match examples:
- "non-space"
- "sf"
Regular expression: (\s{1,})
Validates positive and numeric values that equate to Structure Query Language (SQL) Server data type decimal(18, 2). The value can not be 0, and negative values can be represented using a dash.
Match examples:
- "-9999999999999999.99"
- "9999999999999999.99"
- "1"
Non-match examples:
- "0"
- "0.0"
Regular expression: [-]?[1-9]\d{0,16}\.?\d{0,2}|[-]?[0]?\.[1-9]{1,2}|[-]?[0]?\.[0-9][1-9]
This regex checks if the value is a possible german License Plate. The trailing H stands for Historical cars.
Match examples:
- "F-RM373, WÜ-Z1, K- 07333,HN-WK11H"
- "NZ- PQ9954H"
- "LV- IA47H"
Non-match examples:
- "MOS-AS"
- "hhg"
Regular expression: ^[A-ZÄÖÜ]{1,3}\-[ ]{0,1}[A-Z]{0,2}[0-9]{1,4}[H]{0,1}
Capital (A) or lowercase (a)
Match examples:
- "aaa"
- "aA"
- "Aa"
Non-match examples:
- "bbb"
- "à"
Regular expression: (a|A)
Handles capitalized names. Allows names consisting of 3 parts. Restriction that the name must start with a capital character.
Match examples:
- "Rana Mohsin Ali"
- "Hello There"
- "Joe John Smith"
Non-match examples:
- "rana Mohsin Ali"
- "h"
Regular expression: ^([A-Z]+[a-zA-Z]*)(\s|\-)?([A-Z]+[a-zA-Z]*)?(\s|\-)?([A-Z]+[a-zA-Z]*)?$
This is a pattern that matches the time format as recommended by the w3c for Extended Markup Language (XML) formats.
Match examples:
- "12:00:12"
- "01:12:19Z"
- "23:59:00-06:00"
Non-match examples:
- "1:20:13"
- "12:03"
Regular expression: ^([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])([Z]|\.[0-9]{4}|[-|\+]([0-1][0-9]|2[0-3]):([0-5][0-9]))?$
This pattern matches valid w3c compatible datetime values from 1600 to 9999 in the form of [-]YYYY-MM-DDTHH:MM:SS[.ssss|[[+|-][HH:MM]][Z] also takes into account leap years.
Match examples:
- "2007-11-02T18:00:00.1234"
- "2000-02-29T12:00:12+03:00"
- "6120-02-03T22:45:44"
Non-match examples:
- "2005-01-20"
- "23:00:00"
Regular expression: ^[-]?((1[6789]|[2-9][0-9])[0-9]{2}-(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))T([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])([Z]|\.[0-9]{4}|[-|\+]([0-1][0-9]|2[0-3]):([0-5][0-9]))?$|^[-]?((1[6789]|[2-9][0-9])[0-9]{2}-(0[469]|11)-(0[1-9]|[12][0-9]|30))T([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])([Z]|\.[0-9]{4}|[-|\+]([0-1][0-9]|2[0-3]):([0-5][0-9]))?$|^[-]?((16|[248][048]|[3579][26])00)|(1[6789]|[2-9][0-9])(0[48]|[13579][26]|[2468][048])-02-(0[1-9]|1[0-9]|2[0-9])T([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])([Z]|\.[0-9]{4}|[-|\+]([0-1][0-9]|2[0-3]):([0-5][0-9]))?$|^[-]?(1[6789]|[2-9][0-9])[0-9]{2}-02-(0[1-9]|1[0-9]|2[0-8])T([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])([Z]|\.[0-9]{4}|[-|\+]([0-1][0-9]|2[0-3]):([0-5][0-9]))?$
This captures 0.00 to 25.00.
Match examples:
- "12"
- "13.1"
- "23.99"
Non-match examples:
- "26"
- "25.01"
Regular expression: ^(([0-9]|1[0-9]|2[0-4])(\.[0-9][0-9]?)?)$|([2][5](\.[0][0]?)?)$
Allows "words" with alphanumeric characters, including the underscore _ character. Disallows leading or trailing spaces, also doubled-up spaces within the text.
Match examples:
- "Test 000"
- "hrllec"
- "yo_yo"
Non-match examples:
- "Punctuation! Or doubled up, leading or trailing spaces"
- "to-do"
Regular expression: ^[\w0-9]+( [\w0-9]+)*$
This regex matches US and CAN phone numbers with area codes and optional 3 or 4-digit PBX extension. It does not check for validity of area code or exchange number, other than for starting with a 0 or 1.
Match examples:
- "(555) 687-6076 X 1234"
- "(555) 687-6076"
- "555.687.5511x1234"
Non-match examples:
- "555.687.6076 ext 1234"
- "052) 936.3718 x 674"
Regular expression: ^((([\(]?[2-9]{1}[0-9]{2}[\)]?)|([2-9]{1}[0-9]{2}\.?)){1}[ ]?[2-9]{1}[0-9]{2}[\-\.]{1}[0-9]{4})([ ]?[xX]{1}[ ]?[0-9]{3,4})?$
Matches whole numbers containing the two most common thousands-separators (comma and period). Will not handle decimals.
Match examples:
- "1,000"
- "1.000"
- "1"
Non-match examples:
- "1,00"
- "1,0"
Regular expression: ^[1-9]{1}[0-9]{0,2}([\.\,]?[0-9]{3})*$
UK Vehicle Registration Plate / Number Plate format as specified by the Driving and Vehicle Licensing Agency (DVLA). Accepts both "Prefix" and "New" styles. Allows only valid DVLA number combinations as not all are supported. The registration number must be exactly as is displayed on the car, hence all letters must be in uppercase, and a space separating the two sets of characters.
Match examples:
- "AB12 RCY"
- "CD07 TES"
- "S33 GTT"
Non-match examples:
- "ab12 rcy"
- "CD07 TIS"
Regular expression: ([A-HJ-PR-Y]{2}([0][1-9]|[1-9][0-9])|[A-HJ-PR-Y]{1}([1-9]|[1-2][0-9]|30|31|33|40|44|55|50|60|66|70|77|80|88|90|99|111|121|123|222|321|333|444|555|666|777|888|999|100|200|300|400|500|600|700|800|900))[ ][A-HJ-PR-Z]{3}$
Date Format notations.
Match examples:
- "$YYYY$$MM$$DD$"
Non-match examples:
- "$YY$$MM$$DD$"
- "$DD$$MM$$YYYY$"
Regular expression: ^\$YYYY\$\$MM\$\$DD\$$
Accepts valid Employer Identification Numbers (EIN). It could use a bit of tweaking because these are the current valid prefixes allowed. 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 87, 88, 90, 91, 92, 93, 94, 95, 98, 99
Match examples:
- "55-5555555"
- "1-2345678"
- "99-9999999"
Non-match examples:
- "00-1111111"
- "my-einnumb"
Regular expression: ^[1-9]\d?-\d{7}$
Matches at least 2 char and max 3 characters after a period. (www dot is rejected)
Match examples:
- "yahoo.com"
- "ABC.COM"
- "abc.au"
Non-match examples:
- "yahoo.c"
- "ABC.argv"
Regular expression: ^[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})$
Matches URL tags starting with a url = and enclosed within square brackets.
Match examples:
- "[a url="http://www.example-domain.com"]link text[/a]; [a url=""]link text[/a]"
- "[a url="d@O,EG<@p)8QD$3wQ:^jgjGdk2l6jGf5v~<~l\Ua`\.7x&D|U'&NZ!ozdx+XxL_l__hv4*(a,:2J./dk3-vF?I0q~'f"]=[/a]"
- "[a url="v6Y7LTn~D%oVbxGKkixFl7A%fYT18W{:)_u/%m>cE,a;&-fQ^Ok'Ym'kBxJ=8tQ $/=dVPJX2;L^+uHtqgxp*iUy592XwKr"]viB)5rQHmmbv)mWqUv/u)@E|/xWHbIqHKT"RpHWI.z>R/sR(zt:Y`fTF=&d4vn*e"#Hc&#MSi$olR0R%mgt[/a]"
Non-match examples:
- "[a]link text[/a]; [a url= ""]link text[/a]"
- "e url="w@dd=_|JUSbw~tZ*jL4s3#@0H1H+aSN-24d27CIZYh&8c}{,/k"]/ `tuLJ\Sp~*1b#h^UE{D+xcctWTq}/\u@b{_!?0[/a]"
Regular expression: (\[a url=\"[^\[\]\"]*\"\])([^\[\]]+)(\[/a\])
Matches tags that do not have any parameters.
Match examples:
- "<b>important</b>; <b>anything that should be in bold</b>"
- "<b>Aaf&,iL+3Y]#)/B|z&%q\@G't,h%Klob,/fb8U38h/=EMCe3c^WPL%y_veC4f[zg=x</b>"
- "<b>J|tdQcH7~9%T"8+hD=SB8ls,{/$M.lZ+z|0mH05f_X0D};Q V+s5+gs06x%t</b>"
Non-match examples:
- "<b >important</b>; <b>important<b>"
- "b>kt.ghk={w}Se$R!eQX}p3Q;l"HpCmhjm|zb`aK</b>"
Regular expression: (<b>)([^<>]+)(</b>)
Matches numeric value with optional +/- , optional decimal point, and optional commas
Match examples:
- "-12,345,678,012.98765"
- "+329162643,239806987,332,180,897,161,621386,244,949,556,348,565,319,258,424726092,548678926578321189966475"
- "-82799504,549967255.05381746"
Non-match examples:
- "1,45.098"
- "abcde"
Regular expression: ^[-+]?([0-9]{1,3}[,]?)?([0-9]{3}[,]?)*[.]?[0-9]*$
Matches groups of single-line code comments. Comment sections will be returned as a single match.
Match examples:
- "// code comments"
- "// print"
- "// functions"
Non-match examples:
- "Code"
- "for loop"
Regular expression: ([\r\n ]*//[^\r\n]*)+
Matches C# string literals; verbatim and or normal.
Match examples:
- ""text" "te\"xt" @"text""
- ""#yQ\]_\H\8\~&\G[76\%.w/\G\f%\+\?\[\_N\3j\gly[\E\R""
- "﻿　     ᠎	  　　"HQ.sf}7A4B7?|:l^;wK:6,JQi?AE-R:R""
Non-match examples:
- "text"
- "<>"
Regular expression: (@\s*".*?")|("([^"\\]|\\.)*?")
Matches one Upper-case US ASCII Letter.
Match examples:
- "A"
- "B"
- "Z"
Non-match examples:
- "a"
- "1"
Regular expression: ^[A-Z]$
Matches numbers in four parts separated by decimals.
Match examples:
- "0.0.60829.1"
- "100.3.60931.5"
- "5.1.11219.7"
Non-match examples:
- "1.1.60849.1"
- "0.20.10.60810"
Regular expression: ^\d+\.\d\.\d[01]\d[0-3]\d\.[1-9]\d*$
This will validate any date (does not check for number of days in month, just 31 days or less) in almost any format as long as the order follows month, day, year, hour, minute, and each part has at least 2 digits.
Match examples:
- "01/15/07 1745"
- "011507 1745"
- "01/15/2007 17:45"
Non-match examples:
- "13/15/07 1745"
- "013207 1745"
Regular expression: ^(((0[1-9]{1})|(1[0-2]{1}))\/?(([0-2]{1}[1-9]{1})|(3[0-1]{1}))\/?(([12]{1}[0-9]{1})?[0-9]{2}) ?(([01]{1}[0-9]{1})|(2[0-4]{1}))\:?([0-5]{1}[0-9]{1}))$
Validate if server and port is valid.
Match examples:
- "MyServer:8080"
- "K:916964174854221123755333757035"
- "IzUa8HTdKgD8bUk:8157711142609"
Non-match examples:
- "1Server:A1"
- "Server:AAA"
Regular expression: ^(([A-Z])([a-zA-Z0-9]+)?)(\:)(\d+)$
Matches positive and nonzero real numbers (both integer and decimal are supported).
Match examples:
- "1.234"
- "1234"
- "0.123"
Non-match examples:
- "0"
- "0.0"
Regular expression: (^([0-9]*[.][0-9]*[1-9]+[0-9]*)$)|(^([0-9]*[1-9]+[0-9]*[.][0-9]+)$)|(^([1-9]+[0-9]*)$)
Matches every numeric value except 0.
Match examples:
- "2"
- "23"
- "340"
Non-match examples:
- "0"
- "0009"
Regular expression: ^[1-9]\d*\.?[0]*$
Checks date in format dd-mm-yyyy. Separation characters can be -/. and space.
dd and mm HAVE to be two characters. The year has to be four characters and a minimum 1900. Expression handles leap year as well.
Match examples:
- "20-02-1975"
- "20.02.1975"
- "20/02/1975"
Non-match examples:
- "20-12-1899"
- "29-02-2002"
Regular expression: ^(((0[1-9]|[12]\d|3[01])[\s\.\-\/](0[13578]|1[02])[\s\.\-\/]((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)[\s\.\-\/](0[13456789]|1[012])[\s\.\-\/]((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])[\s\.\-\/]02[\s\.\-\/]((19|[2-9]\d)\d{2}))|(29[\s\.\-\/]02[\s\.\-\/]((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$
This is regular expression that check for a particular date match in the following format respectively: DD-MM-YYYY and is only valid for the years between 1900 - 1999
Match examples:
- "31-01-1923"
- "12-05-1987"
- "26-10-1901"
Non-match examples:
- "07/10/1998"
- "04-07-98"
Regular expression: ^(0[1-9]|[12][0-9]|3[01])-(0[1-9]|11|12|10)-(19[0-9]{2})$
This pattern matches US phone numbers but excludes numbers that are 800 or 900 numbers. It excludes the following area codes 800, 888,877,866, and 900.
Match examples:
- "123-554-1247"
- "844-5698"
- "649-5657"
Non-match examples:
- "800-585-1234"
- "(866)958-4221"
Regular expression: ^(((?!\(800\))(?!\(888\))(?!\(877\))(?!\(866\))(?!\(900\))\(\d{3}\) ?)|(?!800)(?!888)(?!877)(?!866)(?!900)(\d{3}-))?\d{3}-\d{4}
The path must begin with a forward slash. The path segments may not lead or end with an underscore or dash. They also can not be doubled (__ or --).
Match examples:
- "/users/web/mysite/web/cgi-bin"
- "/hi"
- "/2372/23hfw"
Non-match examples:
- "/users/web/my site/web/cgi-bin"
- "users/web/mysite/web/cgi-bin/"
Regular expression: ^((?:\/[a-zA-Z0-9]+(?:_[a-zA-Z0-9]+)*(?:\-[a-zA-Z0-9]+)*)+)$
The string must begin and end with a word character and may contain spaces. No punctuation allowed.
Match examples:
- "My Category"
- "hello"
- "The End"
Non-match examples:
- "any nonword character and leading/trailing spaces"
- "---"
Regular expression: ^([a-zA-Z0-9]+(?: [a-zA-Z0-9]+)*)$
This expression fully checks or enforces the [ws][-]{d|[d.]hh:mm[:ss[.ff]] }[ws] format as described in the MSDN help. It even checks the upper/lower boundaries on day values (10675199 days.)
Match examples:
- "00:00:15"
- "23:59:59"
- "23:59:59.9999999"
Non-match examples:
- "1.23:59:60"
- "24:00"
Regular expression: ^\s*-?(\d{0,7}|10[0-5]\d{0,5}|106[0-6]\d{0,4}|1067[0-4]\d{0,3}|10675[0-1]\d{0,2}|((\d{0,7}|10[0-5]\d{0,5}|106[0-6]\d{0,4}|1067[0-4]\d{0,3}|10675[0-1]\d{0,2})\.)?([0-1]?[0-9]|2[0-3]):[0-5]?[0-9](:[0-5]?[0-9](\.\d{1,7})?)?)\s*$