s2e-lab/RegexEval huggingface dataset:
This expression will allow Letters, periods, apostrophe, dashes.
Match examples:
- "muk.dub'ey-j ava"
- "gkhg"
- "gliu"
Non-match examples:
- "muk_12 dubey`.ja"
- "5dftyvg"
Regular expression: ^([a-zA-Z][a-zA-Z\&amp;amp;\-\.\'\s]*|)$
match strings that contain the word "get" surrounded by word boundaries and followed by an open curly brace '{', with potential characters in between.
Match examples:
- "get {"
- "This is a get { example"
- "get { something }"
Non-match examples:
- "get"
- "f34fgetvfv"
Regular expression: \b(get)\b.*{
Credit Card Matching - Matches Switch, Solo, Visa, MasterCard and Discover. Matches length and valid prefix. Accepts input optional spaces and dashes between number groups
Match examples:
- "5154-1234-1234-1342"
- "4444333322221111"
- "6767 1111 1111 1111"
Non-match examples:
- "1234123412341234"
- "1111111"
Regular expression: ^((67\d{2})|(4\d{3})|(5[1-5]\d{2})|(6011))-?\s?\d{4}-?\s?\d{4}-?\s?\d{4}|3[4,7]\d{13}$
Matches TCP port numbers from 0 to 65535. Other than '0', no leading 0's are accepted.
Match examples:
- "0"
- "1000"
- "65535"
Non-match examples:
- "65536"
- "99999"
Regular expression: ^(0|([1-9]\d{0,3}|[1-5]\d{4}|[6][0-5][0-5]([0-2]\d|[3][0-5])))$
Expression to check Dutch phone numbers. Number must start with zero and number of digits should be 10. Different area and country codes are allowed.
Match examples:
- "+31 0205315386"
- "0031 (0)205315386"
- "0205315386"
Non-match examples:
- "020531538"
- "1205315386"
Regular expression: ^(([+]31|0031)\s\(0\)([0-9]{9})|([+]31|0031)\s0([0-9]{9})|0([0-9]{9}))$
Australian phone numbers including Mobiles and common spacing used. This is used only to test normal contact numbers for residential purposes for example not information lines like 139999.
Match examples:
- "9999 999 999"
- "(09) 9999 9999"
- "99999999"
Non-match examples:
- "99999999999"
- "9999999"
Regular expression: ^[0-9]{10}$|^\(0[1-9]{1}\)[0-9]{8}$|^[0-9]{8}$|^[0-9]{4}[ ][0-9]{3}[ ][0-9]{3}$|^\(0[1-9]{1}\)[ ][0-9]{4}[ ][0-9]{4}$|^[0-9]{4}[ ][0-9]{4}$
Matches Canadian provincial codes.
Match examples:
- "ON"
- "PE"
- "NB"
Non-match examples:
- "OB"
- "NM"
Regular expression: ^(N[BLSTU]|[AMN]B|[BQ]C|ON|PE|SK)$
This will match numbers between 0 and 12. The 0? at the beginning will allow &quot;01&quot; as a valid match. This is useful for validation the month only component of a date part.
Match examples:
- "05"
- "5"
- "12"
Non-match examples:
- "0"
- "1a"
Regular expression: ^(0?[1-9]|1[012])$
Will check to ensure the data is between 1850 and 2100.
Match examples:
- "1850"
- "1977"
- "2100"
Non-match examples:
- "1800"
- "a"
Regular expression: ^((18[5-9][0-9])|((19|20)[0-9]{2})|(2100))$
validate comma separated key/value pair
Match examples:
- "foo=bar"
- "foo1=bar1,foo2=bar2"
- "foo1=bar1,foo2=bar2,"
Non-match examples:
- "foo="
- "foo1=bar1 foo2=bar2"
Regular expression: ^(\w+=[^\s,=]+,)*(\w+=[^\s,=]+,?)?$
matches a date in dd/mm/yyyy format
Match examples:
- "01/01/2001"
- "29/02/2004"
- "17/12/2098"
Non-match examples:
- "32/12/2001"
- "29/02/2005"
Regular expression: ^(((((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])|(19[0-9][0-9])))|((29\/02\/(19|20)(([02468][048])|([13579][26]))))$
Password with minimum 1 Letter (A-Za-z), 1 Number (0-9) and Special Character (\W). It doesn't matter the characters position.
Match examples:
- "test22!!"
- "!!test22"
- "22!!test"
Non-match examples:
- "test22"
- "!!test"
Regular expression: ^(([A-Za-z]+[^0-9]*)([0-9]+[^\W]*)([\W]+[\W0-9A-Za-z]*))|(([A-Za-z]+[^\W]*)([\W]+[^0-9]*)([0-9]+[\W0-9A-Za-z]*))|(([\W]+[^A-Za-z]*)([A-Za-z]+[^0-9]*)([0-9]+[\W0-9A-Za-z]*))|(([\W]+[^0-9]*)([0-9]+[^A-Za-z]*)([A-Za-z]+[\W0-9A-Za-z]*))|(([0-9]+[^A-Za-z]*)([A-Za-z]+[^\W]*)([\W]+[\W0-9A-Za-z]*))|(([0-9]+[^\W]*)([\W]+[^A-Za-z]*)([A-Za-z]+[\W0-9A-Za-z]*))$
Searches for number greater than 0 with thousand delimiter as space, comma or period.
Match examples:
- "1 234 567"
- "1.234.567.890"
- "1,234"
Non-match examples:
- "-12,990"
- "100.03"
Regular expression: (^(\d+)$)|(^(\d{1,3}[ ,\.](\d{3}[ ,\.])*\d{3}|\d{1,3})$)
Return all comment lines (starts with //) and regions (serounded by /* */) as well as compiler arguments (#) in C# code
Match examples:
- "// some comment"
- "#region myRegion"
- "/* other comment */"
Non-match examples:
- "for(int i = 0; i &lt; 10; i++)"
- "[XmlAttribute(&quot;somthing_else&quot;)"
Regular expression: (?:/\*[\w\W]*?\*/|//[^\n]*?$|\#[^\n]*?$)
Accurate Australian postal code verification.
Australia has 4-digit numeric postal codes with the following state based specific ranges.
ACT: 0200-0299 and 2600-2639.
NSW: 1000-1999, 2000-2599 and 2640-2914.
NT: 0900-0999 and 0800-0899.
QLD: 9000-9999 and 4000-4999.
SA: 5000-5999.
TAS: 7800-7999 and 7000-7499.
VIC: 8000-8999 and 3000-3999.
WA: 6800-6999 and 6000-6799.
Match examples:
- "0200"
- "7312"
- "2415"
Non-match examples:
- "0300"
- "7612"
Regular expression: (0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-8][0-9]{2})|(290[0-9])|(291[0-4])|(7[0-4][0-9]{2})|(7[8-9][0-9]{2})
Accurate Canadian postal code format verification.
The format of a Canadian postal code is LDL DLD where L are alpha characters and D are numeric digits. But there are some exceptions. The letters D, F, I, O, Q and U never appear in a postal code because of their visual similarity to 0, E, 1, 0, 0, and V respectively. In addition to avoiding the six &quot;forbidden&quot; letters W and Z also do not appear as the first letter of a postal code (at least not at present).
Match examples:
- "M1R 4B0"
- "L0R 1B1"
- "L0R1B9"
Non-match examples:
- "W1R 4B0"
- "L0R 1D1"
Regular expression: ([ABCEGHJKLMNPRSTVXY][0-9][ABCEGHJKLMNPRSTVWXYZ])\ ?([0-9][ABCEGHJKLMNPRSTVWXYZ][0-9])
Accurate UK postal code format verification. UK postal codes have two parts. The right part is formatted as DLL (L:letter D:digit) and the left part has six alternative formats: LD, LDL, LDD, LLD, LLDL and LLDD. There is only one exception to these formats: GIR 0AA.
Match examples:
- "M2 5BQ"
- "EC1A 1HQ"
- "GIR 0AA"
Non-match examples:
- "M2 BQ5"
- "E31A 1HQ"
Regular expression: (([A-Z]{1,2}[0-9][0-9A-Z]?)\ ([0-9][A-Z]{2}))|(GIR\ 0AA)
VAT Numbers format verification (The Netherlands) with support for optional member state definition.
Match examples:
- "NL123456789B12"
- "NL-603781070B39"
- "404760885B21"
Non-match examples:
- "NL123456789012"
- "NL52/2/54/245"
Regular expression: (NL-?)?[0-9]{9}B[0-9]{2}
match 10-digit US phone numbers with optional brackets (either () or []) around the area code and optional separators (either - or .) between the groups of digits. Whitespace is also optional around the phone number.
Match examples:
- "6105551515"
- "(610) 555 - 1212"
- "[610]555.1212"
Non-match examples:
- "1 (610) 555-1212"
- "(610) 555-1212 ext*"
Regular expression: ^\s*([\(]?)\[?\s*\d{3}\s*\]?[\)]?\s*[\-]?[\.]?\s*\d{3}\s*[\-]?[\.]?\s*\d{4}$
Password validator that validates the password contains 1 letter (regardless of case) and 1 number
Match examples:
- "Password1"
- "1Password"
- "1Password1"
Non-match examples:
- "*Password1"
- "*1Password*"
Regular expression: ^(([a-zA-Z]+\d+)|(\d+[a-zA-Z]+))[a-zA-Z0-9]*$
Password matching expression. Password must consists of at least 6 characters and not more than 20 characters. Password must contain only letters and digits. Password must contain at least 2 digits and at least 2 letters.
Match examples:
- "a1b2c3"
- "65c5t7c"
- "6fv7cv8y"
Non-match examples:
- "aaaaa1"
- "IUBUFID"
Regular expression: ^(?=.*[a-zA-Z].*[a-zA-Z])(?=.*\d.*\d)[a-zA-Z0-9]{6,20}$
This regex will validate the given string is numeric
Match examples:
- "$123.1234"
- ".123"
- ".123e+01"
Non-match examples:
- "asdf"
- ","
Regular expression: ^(?:(?:[+\-]?\$?)|(?:\$?[+\-]?))?(?:(?:\d{1,3}(?:(?:,\d{3})|(?:\d))*(?:\.(?:\d*|\d+[eE][+\-]\d+))?)|(?:\.\d+(?:[eE][+\-]\d+)?))$
It matches % value from 0 - 100. The two decimal places are used.
Match examples:
- "100"
- "99.99"
- "00"
Non-match examples:
- "101"
- "22.1111"
Regular expression: ^100$|^\d{0,2}(\.\d{1,2})? *%?$
This will find any XML within a string starting with the <?xml header and ending with the closing root tag. Replace </note> with your closing root tag. (use singleline and case insensitive) - I use this to pull xml written in a web document.
Match examples:
- "<?xml version="1.0" encoding="ISO-8859-1"?><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>"
- "<?xml version="1.0" encoding="UTF-8" ?><note><to>John</to><from>Jane</from><message>Hello, world!</message></note>"
- "<?xml version="1.0" ?><note><to>Alice</to><from>Bob</from><message>Hi there!</message></note>"
Non-match examples:
- "<?xml version="1.0" encoding="ISO-8859-1"?><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></BADnote>"
- "<\?xml52/2/54/245"
Regular expression: <\?xml.*</note>
This pattern can be used to validate a numeric week (between 01 and 52) and four digit year (valid years between 1000 and 2999) separated by a slash in the form of WW/YYYY.
Match examples:
- "47/2006"
- "01/1840"
- "36/2763"
Non-match examples:
- "00/3005"
- "52/2/54/245"
Regular expression: ^(([1-4][0-9])|(0[1-9])|(5[0-2]))\/[1-2]\d{3}$
Regex to match the ISO Date Format. The time part is optional, including the seconds, as are all of the delimiters (although they must be non-numeric). Each part of the date will be returned as a selection e.g. \1 will contain the Year, \2 will contain the Month.
Match examples:
- "2006-12-31 17:58:00"
- "20061231175800"
- "2006-12-31"
Non-match examples:
- "2006-13-36 25:61:62"
- "52/2/54/245"
Regular expression: ^(\d{4})\D?(0[1-9]|1[0-2])\D?([12]\d|0[1-9]|3[01])(\D?([01]\d|2[0-3])\D?([0-5]\d)\D?([0-5]\d)?)?$
Matches valid date and time strings in the format "YYYY-MM-DD HH:MM:SS," where "YYYY" represents the year, "MM" represents the month, "DD" represents the day, "HH" represents the hour, "MM" represents the minutes, and "SS" represents the seconds.
Match examples:
- "2006-12-31 23:59:59"
- "2023-09-06 08:30:00"
- "1990-05-15 18:45:22"
Non-match examples:
- "2006-13-31 4:59:65"
- "06-12-2006 23:59:59"
Regular expression: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-2]) ([0-1][0-9]|2[0-4]):([0-4][0-9]|5[0-9]):([0-4][0-9]|5[0-9])$
Matches any unsigned floating point number/numeric string.
Match examples:
- "123"
- "3.14159"
- "45768"
Non-match examples:
- "abc"
- "-3.14159"
Regular expression: ^\d+(\.\d+)?$
Matches the UK Drivers License format as laid down by the DVLA / dvla. Matches: 1. Must be 16 characters 2. First 5 characters are alphanumeric. 3. Next 6 characters must be numeric 4. Next 3 characters are alphanumeric 5. Last 2 characters are alpha 6. Second character of numeric section can only be 0, 1, 5 or 6. 7. Fourth and fifth characters of numeric section must be in the range 01 to 31.
Match examples:
- "JOHNS711215GG9SY"
- "EC6JU003207KEREJ"
- "9E8LU167058OOCLI"
Non-match examples:
- "JOHNS731215GG9SY"
- "8FG78G78EWDG78G"
Regular expression: [A-Z0-9]{5}\d[0156]\d([0][1-9]|[12]\d|3[01])\d[A-Z0-9]{3}[A-Z]{2}
Checks that the input is a positive integer in the range 0-32767
Match examples:
- "32767"
- "0"
- "999"
Non-match examples:
- "99999"
- "-1"
Regular expression: ^(3276[0-7]|327[0-5]\d|32[0-6]\d{2}|3[01]\d{3}|[12]\d{4}|[1-9]\d{3}|[1-9]\d{2}|[1-9]\d|\d)$
The OAGIS standard has a format for phone and fax as +###(###)#######.
Match examples:
- "+555(555)5555555"
- "+1(800)5555555"
- "+617(355)2470357"
Non-match examples:
- "555"
- "52/2/54/245"
Regular expression: ^\+[0-9]{1,3}\([0-9]{3}\)[0-9]{7}$
Matches all IPV6 and IPV4 addresses. Doesn't limit IPV4 to just values of 255. Doesn't allow IPV6 compression.
Match examples:
- "0:123:af00:ffff:0C67:0:0:8787"
- "0:0:0:0:0:0:0:1"
- "0.0.0.1"
Non-match examples:
- "::1"
- "52/2/54/245"
Regular expression: ([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(\d{1,3}\.){3}\d{1,3}
This pattern validates a British Ordnance Survey Grid/Tile/Sheet Reference Number.
Match examples:
- "NA1234SE"
- "OV5571"
- "SG2714926378"
Non-match examples:
- "AA1234SE"
- "YI67fyvG"
Regular expression: ^(H(P|T|U|Y|Z)|N(A|B|C|D|F|G|H|J|K|L|M|N|O|R|S|T|U|W|X|Y|Z)|OV|S(C|D|E|G|H|J|K|M|N|O|P|R|S|T|U|W|X|Y|Z)|T(A|F|G|L|M|Q|R|V)){1}\d{4}(NE|NW|SE|SW)?$|((H(P|T|U|Y|Z)|N(A|B|C|D|F|G|H|J|K|L|M|N|O|R|S|T|U|W|X|Y|Z)|OV|S(C|D|E|G|H|J|K|M|N|O|P|R|S|T|U|W|X|Y|Z)|T(A|F|G|L|M|Q|R|V)){1}(\d{4}|\d{6}|\d{8}|\d{10}))$
match strings that contain a specific text pattern typically found in HTML documents where <title> tags enclose some content.
Match examples:
- "<title>this title</title>"
- "<title>fadsf2fe</title>"
- "<title>2dffd</title>"
Non-match examples:
- "any other tags"
- "title"
Regular expression: <title>+(.*?)</title>
This regex find valid <h1-6> html tags
Match examples:
- "<h2>test2</h2><h3>test3</h3>"
- "<h1>Heading 1</h1>"
- "<h2>Subheading</h2>"
Non-match examples:
- "<h>test1</h>"
- "<h7>Invalid Heading</h7>"
Regular expression: <h([1-6])>([^<]*)</h([1-6])>
This is a more robust regex for matching Chemical Abstract Service (CAS) Numbers. This distinguishes between CAS numbers and other identifiers (e.g. EC number).
Match examples:
- "50-00-0"
- "75-18-5"
- "41-40-4"
Non-match examples:
- "200-001-8"
- "52/2/54/245"
Regular expression: \b[1-9]{1}[0-9]{1,5}-\d{2}-\d\b
Requires area code. Allows extension. Any common US format works.
Match examples:
- "1 (123) 123-1234 ext. 1234567"
- "1 (123) 123-1234"
- "(123) 123-1234"
Non-match examples:
- "123/1234 L. 12345678"
- "52/2/54/245"
Regular expression: ^(\d)?[ ]*[\(\.\-]?(\d{3})[\)\.\-]?[ ]*(\d{3})[\.\- ]?(\d{4})[ ]*(x|ext\.?)?[ ]*(\d{1,7})?$
This expression should work to validate that an uploaded file's extension is either jpg, gif, or png.
Match examples:
- "foo.gif"
- "foo.jpg"
- "foo.png"
Non-match examples:
- "foo.txt"
- "foo.zip"
Regular expression: .*(\.[Jj][Pp][Gg]|\.[Gg][Ii][Ff]|\.[Jj][Pp][Ee][Gg]|\.[Pp][Nn][Gg])
This pattern matches on Integer values. Handles leading positive or negative signs. Supports commas where only the leading group can have less than three digits.
Match examples:
- "+1"
- "-2"
- "3,000"
Non-match examples:
- "A"
- "1,23"
Regular expression: ^[-+]?(\d?\d?\d?,?)?(\d{3}\,?)*$
Had to handle both "," and "." as separator in a validationscript where values are between 0.0 and 2.0 like in results of Swedish Högskoleprov (SAT).
Match examples:
- "0,0"
- "0.0"
- "1,9"
Non-match examples:
- "2,1"
- "1"
Regular expression: ^([0-1](?:\.\d)|[0-1](?:\,\d)|(2\.0)|(2\,0))$
It will allow for alphanumeric characters only, with the exception of spacing.
Match examples:
- "Website Users"
- "g67g"
- "f667f8"
Non-match examples:
- "Website Users!"
- ";f;ds;f"
Regular expression: ^[a-zA-Z0-9\040]+$
Matches number with optional commas and decimal places. Allows only max 7 digits before decimal and max 2 digits after decimal. Does not allow numbers beginning with 0 e.g., $0,234,567 but allows $0.05
Match examples:
- "($1,234,567.89)"
- "$1,234,567.89"
- "$1234567.89"
Non-match examples:
- "$1,234,567.890"
- "$12345678.90"
Regular expression: ^\$([0]|([1-9]\d{1,2})|([1-9]\d{0,1},\d{3,3})|([1-9]\d{2,2},\d{3,3})|([1-9],\d{3,3},\d{3,3}))([.]\d{1,2})?$|^\(\$([0]|([1-9]\d{1,2})|([1-9]\d{0,1},\d{3,3})|([1-9]\d{2,2},\d{3,3})|([1-9],\d{3,3},\d{3,3}))([.]\d{1,2})?\)$|^(\$)?(-)?([0]|([1-9]\d{0,6}))([.]\d{1,2})?$
with or without area code (of various forms)(does not allow for unbalanced parens in the area code). With or without an extension (of various forms). Does not allow for leading or trailing space.
Match examples:
- "(123)-456-7890 Ext 1234"
- "123-456-7890"
- "(123).456.7890"
Non-match examples:
- "123)4567890"
- "800callcat"
Regular expression: ^(((\(\d{3}\)|\d{3})( |-|\.))|(\(\d{3}\)|\d{3}))?\d{3}( |-|\.)?\d{4}(( |-|\.)?([Ee]xt|[Xx])[.]?( |-|\.)?\d{4})?$
capture labels having format yyyy.mm.dd.nn here nn is for number s from 00 to 99
Match examples:
- "2006.10.09.05"
- "1672.08.31.93"
- "0081.12.30.60"
Non-match examples:
- "06.13.32.123"
- "52/2/54/245"
Regular expression: ^(\d{4})[.](0{0,1}[1-9]|1[012])[.](0{0,1}[1-9]|[12][0-9]|3[01])[.](\d{2})$
Just a small pattern to make sure commas are in the right place (if present). Only allows one decimal to be suffixed with with 1 or 2 digits. Also optional dollar sign may proceed value.
Match examples:
- "$1,000,000.00"
- "123,000"
- "455,123"
Non-match examples:
- "43,3.245"
- "423,423,4,234,234"
Regular expression: ^\$?\d{1,3}(,?\d{3})*(\.\d{1,2})?$
This regex performs a crude test on the given input string.
The danish cilvil registration number consists of 10 numeric characters and one special character '-'. The format is DDMMYY-XXXX.
Match examples:
- "010380-2343"
- "120454-5467"
- "390178-3434"
Non-match examples:
- "1223876776"
- "4023100923"
Regular expression: ^[0-3][0-9][0-1]\d{3}-\d{4}?
Matches a string if it is valid in the form of MWF or TTHS. Maybe used for validating the "days part" of a class schedule field. The string should only accept any of the ff set of letters: 'M' 'T' 'W' 'TH' 'F' 'S' 'SU' . Only one instance of these set of letters is accepted.
Match examples:
- "MWF"
- "TTHS"
- "MT"
Non-match examples:
- "MM"
- "WM"
Regular expression: ^M{0,1}T{0,1}W{0,1}(TH){0,1}F{0,1}S{0,1}(SU){0,1}$
matches time in both 12-hour and 24-hour formats, capturing hours, minutes, and an optional space followed by "AM," "PM," "A," or "P."
Match examples:
- "1:30 AM"
- "01:20 AM"
- "10:00A"
Non-match examples:
- "13:00 A"
- "01:5 AM"
Regular expression: ^(([0][0-9]|[1][0-2])|[0-9]):([0-5][0-9])( *)((AM|PM)|(A|P))$
Matches any unsigned or signed floating point number/numeric string.
Match examples:
- "123"
- "3.14159"
- "-1.2"
Non-match examples:
- "abc"
- "3.4.2"
Regular expression: ^-?\d+(\.\d+)?$
Just a simple US State regex. Requires valid 2 letter abbreviations.
Match examples:
- "CO"
- "GA"
- "TX"
Non-match examples:
- "A"
- "ZZ"
Regular expression: ^(?:(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY]))$
Matches dates in mm/dd/yyyy format. Matches only valid dates -except is unable to test for a leapyear. Always allows February 29th. Allows years from 1901 to 2199.
Match examples:
- "02/21/1972"
- "12/31/2199"
- "09/04/1901"
Non-match examples:
- "02/31/1999"
- "02-21-1972"
Regular expression: (?:(?:(?:04|06|09|11)\/(?:(?:[012][0-9])|30))|(?:(?:(?:0[135789])|(?:1[02]))\/(?:(?:[012][0-9])|30|31))|(?:02\/(?:[012][0-9])))\/(?:19|20|21)[0-9][0-9]
Verifica que un RUT tenga el formato 00.000.000-X, despues de comprobar el formato será necesario validar su dígito verificador.
Match examples:
- "12.025.365-6"
- "5.698.124-k"
- "7.999.647-K"
Non-match examples:
- "125.326.452-1"
- "15.336.054-H"
Regular expression: ^\d{1,2}\.\d{3}\.\d{3}[-][0-9kK]{1}$
This pattern match the Italian Istat Ateco Code (Codice Istat) updated to Istat Declaration Ateco 2004
Match examples:
- "22.12.0"
- "18.24.C"
- "98.65.T"
Non-match examples:
- "22.12_D"
- "12.56"
Regular expression: \d{2}[.]{1}\d{2}[.]{1}[0-9A-Za-z]{1}
International Bank Account Number (IBAN) Italian. Identify Bank account in Italy.
Match examples:
- "IT28 W800 0000 2921 0064 5211 151"
- "IT28W8000000292100645211151"
- "IT47r6150582949310134977462"
Non-match examples:
- "IT28-W800-0000-2921-0064-5211-151"
- "52/2/54/245"
Regular expression: IT\d{2}[ ][a-zA-Z]\d{3}[ ]\d{4}[ ]\d{4}[ ]\d{4}[ ]\d{4}[ ]\d{3}|IT\d{2}[a-zA-Z]\d{22}
Matches Visa CC types 13 or 16 digits starting with 4 including Visa CC, Visa ATM only, Visa Electron and Visa Delta. Safe for international and will NOT match "^(49)" Switch debit cards.
Match examples:
- "4111111111111111"
- "4903302261507834"
- "4467220202996"
Non-match examples:
- "4903020000000008"
- "52/2/54/245"
Regular expression: (^4\d{12}$)|(^4[0-8]\d{14}$)|(^(49)[^013]\d{13}$)|(^(49030)[0-1]\d{10}$)|(^(49033)[0-4]\d{10}$)|(^(49110)[^12]\d{10}$)|(^(49117)[0-3]\d{10}$)|(^(49118)[^0-2]\d{10}$)|(^(493)[^6]\d{12}$)
Matches any of Solo, Switch or Maestro. International safe. Will not match on Discover, Visa or Mastercard. For example; Most recommendations for matching Visa are that they start with "4". If outside the US, this are incomplete on will falsly ID most Switch cards as Visa.
Match examples:
- "6334500000000003"
- "65787411526656"
- "6011273550429"
Non-match examples:
- "6011000000000004"
- "52/2/54/245"
Regular expression: (^(5[0678])\d{11,18}$)|(^(6[^05])\d{11,18}$)|(^(601)[^1]\d{9,16}$)|(^(6011)\d{9,11}$)|(^(6011)\d{13,16}$)|(^(65)\d{11,13}$)|(^(65)\d{15,18}$)|(^(49030)[2-9](\d{10}$|\d{12,13}$))|(^(49033)[5-9](\d{10}$|\d{12,13}$))|(^(49110)[1-2](\d{10}$|\d{12,13}$))|(^(49117)[4-9](\d{10}$|\d{12,13}$))|(^(49118)[0-2](\d{10}$|\d{12,13}$))|(^(4936)(\d{12}$|\d{14,15}$))
Validates both ISBN 10 and ISBN 13 numbers, and confirms ISBN 13 numbers start with only 978 or 979.
Match examples:
- "0672317249"
- "9780672317248"
- "357392943X"
Non-match examples:
- "0-672-31724-9"
- "5555555555555"
Regular expression: ^(97(8|9))?\d{9}(\d|X)$
alphanumeric - no space allowed - requires at least one character
Match examples:
- "a123b"
- "56"
- "d6"
Non-match examples:
- "a 1"
- "52/2/54/245"
Regular expression: ^[\w]{1,}$
It matches private IP addresses. Private IP addresses (as defined by RFC 1918) are not routable on public Internet. This would help if you want to grant some previlege only to the users from within local network. This pattern assumes that the input is a valid IP address.
Match examples:
- "10.12.0.19"
- "172.21.0.23"
- "192.168.0.2"
Non-match examples:
- "222.12.3.24"
- "172.12.0.12"
Regular expression: (^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^127\.0\.0\.1)
This will validate a partial postcode beginning with the postal district on up to the whole postcode, returning the two halves in sub-expressions. The main purpose is to return a valid postal district from a partial or whole postcode. The real value in this regex lies in the fact that it will process the postcode correctly regardless of whether or not the space in present after the district. So the accepted formats are A1 1AA, A11 1AA, A1A 1AA, AA1 1AA, AA11 1AA, AA1A 1AA GIR 0AA (and the same 6 formats without the space are also accepted). Requires postcodes to be upper-case.
Match examples:
- "W1A1AB"
- "GIR0L"
- "GIR2KU"
Non-match examples:
- "WWW1AB"
- "c:\f34fvfv"
Regular expression: ^(GIR|[A-Z]\d[A-Z\d]?|[A-Z]{2}\d[A-Z\d]?)[ ]??(\d[A-Z]{0,2})??$
Validates a complete UK postcode. Returns the two halves in sub-expressions. Supports the following 7 formats: A1 1AA, A11 1AA, A1A 1AA, AA1 1AA, AA11 1AA, AA1A 1AA GIR 0AA (** And the same 7 formats without the space are also accepted). (requires postcodes to be upper-case)
Match examples:
- "GIR0AA"
- "SV85 9SV"
- "T0J 4XZ"
Non-match examples:
- "WWW1AB"
- "c:\f34fvfv"
Regular expression: ^(GIR|[A-Z]\d[A-Z\d]??|[A-Z]{2}\d[A-Z\d]??)[ ]??(\d[A-Z]{2})$
match coordinate pairs in the format of latitude (North/South) followed by longitude (West/East), where both latitude and longitude are represented by numbers.
Match examples:
- "0N 0W"
- "34N 118W"
- "0s 0e"
Non-match examples:
- "aw 0N 0W"
- "12345"
Regular expression: ^[0-9]+[NnSs] [0-9]+[WwEe]$
Checks time in 24 hours notation
Match examples:
- "23:00"
- "12:21"
- "0:00"
Non-match examples:
- "24:00"
- "23:60"
Regular expression: ^([0-1]?[0-9]|[2][0-3]):([0-5][0-9])$
This regular expression will validate most (current & future) date options. The weaknesses with this one is that it will allow the days to go up to 39 and does not account for leap year. Also, the months can go up to 19, instead of our commonly accepted 12 month year.
Match examples:
- "2/14/2001"
- "12/29/2099"
- "19/39/2000"
Non-match examples:
- "12/29/1999"
- "20/40/2100"
Regular expression: ^([0-1]?[0-9]{1}/[0-3]?[0-9]{1}/20[0-9]{2})$
one or more numbers, asterisk, one or more numbers, asterisk, one or more numbers, no letters or punctuation other than asterisks.
Match examples:
- "123*4578*8908650"
- "14*523*154"
- "14*4*5432"
Non-match examples:
- "12a*99989*9096"
- "52/2/5*4/82*45"
Regular expression: ^\d+\*\d+\*\d+$
Matches percentages from 0-100 inclusive with two decimal places.
Match examples:
- "0"
- "100"
- "100.00"
Non-match examples:
- "101"
- "-5"
Regular expression: ^100(\.0{0,2}?)?$|^\d{0,2}(\.\d{0,2})?$