s2e-lab/RegexEval huggingface dataset:
Single field zip code validator useful for web forms, where user may enter 5 digit or 9 digit zip code, and may use hyphen, space, or no space between the first 5 digits and last 4 digits.
Match examples:
- "92078"
- "92078-4705"
- "92078 4705"
Non-match examples:
- "920781"
- "920a87"
Regular expression: ^\d{5}((\-|\s)?\d{4})?$
Swedish person number.
Match examples:
- "19740609-7845"
- "19811116-7845"
- "20010913-7598"
Non-match examples:
- "21003612-9999"
- "18790505-4545"
Regular expression: [1-2][0|9][0-9]{2}[0-1][0-9][0-3][0-9][-][0-9]{4}
Validate American date formats: mm/dd/yyyy or m/d/yy or m.d.yyyy with separators: . - /
Valid dates only! m (1-12)/ d (1-31)/ y (0..)
Match examples:
- "10.03.1979"
- "12/30/2004"
- "01/01/2004"
Non-match examples:
- "09--02--2004"
- "15-15-2004"
Regular expression: ^([0]?[1-9]|[1][0-2])[./-]([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0-9]{4}|[0-9]{2})$
Matches the date format &quot;YYYY-mm-dd&quot; and also validates month and number of days in a month. All leap year dates &quot;YYYY-02-29&quot; passes trough.
Match examples:
- "2004-04-30"
- "2004-02-29"
- "4214-06-30"
Non-match examples:
- "2004-04-31"
- "2004-02-30"
Regular expression: ^[0-9]{4}-(((0[13578]|(10|12))-(0[1-9]|[1-2][0-9]|3[0-1]))|(02-(0[1-9]|[1-2][0-9]))|((0[469]|11)-(0[1-9]|[1-2][0-9]|30)))$
IPv4 ip:port checker, I hope it will help you. $1 - IP, $2 - port.
Match examples:
- "127.0.0.1:80"
- "255.255.255.0:21"
- "1.0.0.0:1"
Non-match examples:
- "0.0.0.0:1"
- "256.1.1.1:20"
Regular expression: ^((?:2[0-5]{2}|1\d{2}|[1-9]\d|[1-9])\.(?:(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)\.){2}(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)):(\d|[1-9]\d|[1-9]\d{2,3}|[1-5]\d{4}|6[0-4]\d{3}|654\d{2}|655[0-2]\d|6553[0-5])$
Validates US or Canadian phone numbers with the use of &quot;-&quot; or numbers stuck together. No parantheses allowed as well as spaces. Area code is optional. The &quot;9,&quot; is optional as well, which on some phone systems is needed to dial out.
Match examples:
- "9,5143393044"
- "9,514-339-3044"
- "339-3044"
Non-match examples:
- "9,339 3044"
- "514 440 2009"
Regular expression: ^(9,)*([1-9]\d{2}-?)*[1-9]\d{2}-?\d{4}$
Match a positive or negative decimal value with any precision and scale. Allows for left-padded zeroes, commas as group separator, negative sign (-) or parenthesis to indicate negative number.
Match examples:
- "0.123"
- "(1234.123)"
- "-01,200"
Non-match examples:
- "2.3.123"
- "1,23.45"
Regular expression: ^\-?\(?([0-9]{0,3}(\,?[0-9]{3})*(\.?[0-9]*))\)?$
Validates against a U.S. postal code in either a 5 digit format or a 5 dash 4 format.
Match examples:
- "18017"
- "18017-1401"
- "21389-6392"
Non-match examples:
- "1801A"
- "18017-"
Regular expression: ^([0-9]{5})([\-]{1}[0-9]{4})?$
Validate against a visa card number. All visa cards start with a 4 and are followed by 12 to 15 more numbers.
Match examples:
- "4125632152365"
- "418563256985214"
- "4125632569856321"
Non-match examples:
- "3125652365214"
- "41256321256"
Regular expression: ^([4]{1})([0-9]{12,15})$
Validate against any mastercard number. All MC's start with a number between 51 and 55 and are followed by 14 other numbers.
Match examples:
- "5125632154125412"
- "5225632154125412"
- "5525632154125412"
Non-match examples:
- "5625632154125412"
- "4825632154125412"
Regular expression: ^([51|52|53|54|55]{2})([0-9]{14})$
Matches UK postcodes of the below formats. The space is optional.
AN NAA
AAN NAA
ANN NAA
ANA NAA
AANA NAA
AANN NAA
Match examples:
- "A11AA"
- "AA1A 1AA"
- "AA11 1AA"
Non-match examples:
- "AAA 1AA"
- "AA11A 1AA"
Regular expression: ^(([A-Z]{1,2}[0-9]{1,2})|([A-Z]{1,2}[0-9][A-Z]))\s?([0-9][A-Z]{2})$
Trim inside a string by replacing multiple consecutive spaces between characters with a single space, without altering leading or trailing spaces.
Match examples:
- "Too  Many spaces."
- "hdfu   fhhu"
- "bufy.  sd fuhi"
Non-match examples:
- "No extra spaces"
- "No Extra spaces Inside"
Regular expression: (\S+)\x20{2,}(?=\S+)
Match a string in CCYYMM/YYYYMM format.
Match examples:
- "200401"
- "000001"
- "200412"
Non-match examples:
- "aaa"
- "20040123"
Regular expression: ^[0-9]{4}((0[1-9])|(1[0-2]))$
Matches a negative or positive percentage between 0 and 100 (inclusive). Accepts up to 2 decimal places.
Match examples:
- "12.34"
- "100.00"
- "-2.1"
Non-match examples:
- "101.1"
- "10.123"
Regular expression: ^-?[0-9]{0,2}(\.[0-9]{1,2})?$|^-?(100)(\.[0]{1,2})?$
Removes &quot;stop&quot; or &quot;delete&quot; words that google removes from search strings. Ordinarily have no search significance. I used this to remove the words in my own web search application. Take out the ?: for grouping.
Match examples:
- "by"
- "when"
- "or"
Non-match examples:
- "bye"
- "craptastic"
Regular expression: \b(?:a(?:[nst]|re|nd)?|b[ey]|f(?:or|rom)|i[nst]?|o[fnr]|t(?:o|hat|he|his)|w(?:as|h(?:at|en|ere|ich|o)|i(?:th|ll)))\b
Expression validating a Binary string of any length
Match examples:
- "10101000"
- "01010000"
- "100000001"
Non-match examples:
- "01000200"
- "00021000"
Regular expression: ^([0-1])*$
Hex number/string validation method for the Electronic Serial Number(ESN) used in Cellular Phone products.
Match examples:
- "8ECCA04F"
- "82E5AAA4"
- "82e5aaa4"
Non-match examples:
- "8ECCAOF"
- "82E5AA4"
Regular expression: ^([0-9a-fA-F]){8}$
Validates UK domestic landline phone numbers.
Valid formats are:
029 99999999 or 029 9999 9999; 0199 9999999 or 0199 999 9999; 01999 99999; 01999 999999; 019999 9999; 019999 99999. These formats are taken from the official guidelines from Ofcom, the organization responsible for UK telecoms issues. Brackets are not valid and STD code must be entered.
Match examples:
- "020 1234 5678"
- "0123 4567890"
- "01234 456789"
Non-match examples:
- "02476 123456"
- "0845 123456"
Regular expression: (02\d\s?\d{4}\s?\d{4})|(01\d{2}\s?\d{3}\s?\d{4})|(01\d{3}\s?\d{5,6})|(01\d{4}\s?\d{4,5})
Validates UK mobile phone numbers. Valid formats are `077', `078' or `079' followed by another 8 digits, with an optional space after the dialling code and/or between the 4th and 5th characters of the remainder of the number. Brackets are not valid and STD code must be entered.
Match examples:
- "07713 345678"
- "078 12345678"
- "079 12345678"
Non-match examples:
- "02344 123456"
- "0121 292929"
Regular expression: (077|078|079)\s?\d{2}\s?\d{6}
Matches month, requires that months 1-9 have a leading 0
Match examples:
- "01"
- "02"
- "12"
Non-match examples:
- "1"
- "2"
Regular expression: ^((0[1-9])|(1[0-2]))$
This regex pattern matches time-like strings in the format: "HH:MM:SS.SSSSSSS" (hours, minutes, seconds, and optional fractional seconds). It allows for negative values, leading/trailing whitespace, and allows for optional single-digit hours, minutes, and seconds.
Match examples:
- "10:12:34"
- "932323.9:00:32.3420"
- "12:34:56"
Non-match examples:
- "10:20:80"
- "f34fvfv"
Regular expression: ^\s*-?(\d*\.)?([0-2])?[0-9]:([0-5])?[0-9]:([0-5])?[0-9](\.[0-9]{1,7})?\s*$
Matches numbers in the format of a single digit, with an optional leading digit in the range 1-9 and an optional decimal part consisting of a period followed by one digit.
Match examples:
- "1"
- "1.1"
- "0.1"
Non-match examples:
- "01"
- "01.1"
Regular expression: ^([1-9]{0,1})([0-9]{1})(\.[0-9])?$
regex to validate unix device names (linux). useful for scripts using ifconfig or stuff
Match examples:
- "eth0"
- "eth0:4"
- "eth4:9"
Non-match examples:
- "eth0:"
- "eth0:0"
Regular expression: ^(eth[0-9]$)|(^eth[0-9]:[1-9]$)
RAR file extensions.
Works also with '*.part01.rar' given '.rar' to be the file extension.
Does not support volumes exceed 101 for s## (r99, s00, s01, ...) serie.
Match examples:
- ".RAr"
- ".r01"
- ".012"
Non-match examples:
- ".rxr"
- ".a01"
Regular expression: ^\.([rR]([aA][rR]|\d{2})|(\d{3})?)$
Matches Spanish CIF, NIF and NIE formats. Recognises separation of letters with the hyphen or period.
Format CIF: [1 letter][7 numbers][1 number or letter]
Format NIF: [8 numbers][1 letter]
Format NIE: X[possible 0][7 numbers][1 letter]
Note that this expression does not check for the validity of the NIF/CIF/NIE.
Match examples:
- "X01343567-D"
- "B-6116622G"
- "43544122-R"
Non-match examples:
- "43.544.122-R"
- "f34fvfv"
Regular expression: ^(X(-|\.)?0?\d{7}(-|\.)?[A-Z]|[A-Z](-|\.)?\d{7}(-|\.)?[0-9A-Z]|\d{8}(-|\.)?[A-Z])$
Matches full and compressed IPv6 addresses as defined in RFC 2373.
Match examples:
- "FEDC:BA98:7654:3210:FEDC:BA98:7654:3210"
- "1080::8:800:200C:417A"
- "::FFFF:129.144.52.38"
Non-match examples:
- "FEDC::7654:3210::BA98:7654:3210"
- "FEDC:BA98:7654:3210"
Regular expression: ^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$
Matches monetary values with optional dollar signs and supports thousands separators. It enforces that the value must have at least one digit before the decimal point and exactly two digits after the decimal point, if present.
Match examples:
- "$1,234,567.89"
- "1234567.89"
- "$9.99"
Non-match examples:
- "$1,2345,67.89"
- "$1234,345,678.0"
Regular expression: ^(\$|)([1-9]\d{0,2}(\,\d{3})*|([1-9]\d*))(\.\d{2})?$
Match the full names of the four main characters of The Flintstones.
Match examples:
- "Fred Flintstone"
- "Barney Rubble"
- "Betty Rubble"
Non-match examples:
- "The Great Gazoo"
- "Mr. Slate"
Regular expression: ^((Fred|Wilma)\s+Flintstone|(Barney|Betty)\s+Rubble)$
Validator for New Zealand Mobile phone numbers. Will look for the first number being a 0 and must be a number or either 6 or 7 digits long after to initial (021) suffix
Match examples:
- "(021)1234567"
- "(021)123456"
- "(000)000000"
Non-match examples:
- "(123)1234567"
- "025123456"
Regular expression: (^\([0]\d{2}\))(\d{6,7}$)
Very simple expression to validate time on a 12 hour clock, this expression is valid for client-side script validations.
Match examples:
- "08:00AM"
- "10:00am"
- "7:00pm"
Non-match examples:
- "13:00pm"
- "12:65am"
Regular expression: ^([1-9]|1[0-2]|0[1-9]){1}(:[0-5][0-9][aApP][mM]){1}$
matches strings that only consist of one or more alphanumeric characters (letters and/or digits).
Match examples:
- "adad1213"
- "1231dfadfa"
- "dfad123dfasdfs"
Non-match examples:
- "dfa@#12313"
- "*(*sdfasdfadfd"
Regular expression: ^[a-zA-Z0-9]+$
dd/MM/yyyy with leap years 100% integrated Valid years : from 1900 to 9999.
Match examples:
- "29/02/2000"
- "30/04/2003"
- "01/01/2003"
Non-match examples:
- "29/02/2001"
- "30-04-2003"
Regular expression: ^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$
Accepts only positive decimal values. Zero and negative numbers are non-matching. Allows zeros after last non-zero numeric value after decimal place for significant digits.
Match examples:
- "01.23"
- "0.15"
- "0.1568"
Non-match examples:
- "0"
- "-0.18"
Regular expression: (^[+]?\d*\.?\d*[1-9]+\d*$)|(^[+]?[1-9]+\d*\.\d*$)
Simple American date format mm-dd-yyyy or mm-dd-yy, no time. Date range is 1900 --&gt; 2099.
Match examples:
- "02-29-2004"
- "1/31/1997"
- "1-2-03"
Non-match examples:
- "02-29-2003"
- "04-31-2003"
Regular expression: ^(((((((0?[13578])|(1[02]))[\.\-/]?((0?[1-9])|([12]\d)|(3[01])))|(((0?[469])|(11))[\.\-/]?((0?[1-9])|([12]\d)|(30)))|((0?2)[\.\-/]?((0?[1-9])|(1\d)|(2[0-8]))))[\.\-/]?(((19)|(20))?([\d][\d]))))|((0?2)[\.\-/]?(29)[\.\-/]?(((19)|(20))?(([02468][048])|([13579][26])))))$
yyyyMMdd with leap year validation, starting from year 2000 only.
Match examples:
- "20000101"
- "20051231"
- "20040229"
Non-match examples:
- "19990101"
- "20053112"
Regular expression: ^([2-9]\d{3}((0[1-9]|1[012])(0[1-9]|1\d|2[0-8])|(0[13456789]|1[012])(29|30)|(0[13578]|1[02])31)|(([2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00))0229)$
yyMMdd with leap years.
Minimized expression.
As we have only 2 numbers for the years, dates 1600, 2000, etc are still validated.
Match examples:
- "001231"
- "000229"
- "040229"
Non-match examples:
- "003112"
- "000431"
Regular expression: ^(\d{2}((0[1-9]|1[012])(0[1-9]|1\d|2[0-8])|(0[13456789]|1[012])(29|30)|(0[13578]|1[02])31)|([02468][048]|[13579][26])0229)$
HHmmss without any separators. Hours in 24h format.
Match examples:
- "235959"
- "000000"
- "012345"
Non-match examples:
- "240000"
- "23:59:59"
Regular expression: ^([01]\d|2[0123])([0-5]\d){2}$
Matches all positive decimal values.
Match examples:
- "0.00"
- "1.23"
- "4.56"
Non-match examples:
- "-1.03"
- "-0.01"
Regular expression: (^\d*\.?\d*[0-9]+\d*$)|(^[0-9]+\d*\.\d*$)
MM/dd/yyyy with 100% leap year validation starting from year 2000.
Match examples:
- "02/29/2000"
- "02/29/2004"
- "12/31/2001"
Non-match examples:
- "02/29/2100"
- "02/29/2001"
Regular expression: ^(((0[1-9]|1[012])/(0[1-9]|1\d|2[0-8])|(0[13456789]|1[012])/(29|30)|(0[13578]|1[02])/31)/[2-9]\d{3}|02/29/(([2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00)))$
Formatted Number with "," as thousand separator and "." as decimal separator. now accept numbers without separators of thousands.
Match examples:
- "10,000,000.123"
- "3.14159265"
- "546.4985"
Non-match examples:
- "2.7,1828183"
- "49.26484,65"
Regular expression: ^\-?[0-9]{1,3}(\,[0-9]{3})*(\.[0-9]+)?$|^[0-9]+(\.[0-9]+)?$
This simple reg-ex accepts any vowel letter(AEIOUYaeiouy).
Match examples:
- "a"
- "o"
- "e"
Non-match examples:
- "z"
- "x"
Regular expression: [AaEeIiOoUuYy]
Allows up to seven digits to the left and up to nine digits to the right of an optional decimal place.
Leading zeros on the left of the decimal are accepted.
Only positive values are accepted.
Refined prompt:
Match examples:
- "1"
- "0123456.123456789"
- ".123456789"
Non-match examples:
- ".0123456789"
- "0.0"
Regular expression: ^(?=.*[1-9].*$)\d{0,7}(?:\.\d{0,9})?$
Applied to a .RTF document, returns all the names of the# bookmarks. Useful to retrieve# dinamically# the list of bookmarks from a document.
Match examples:
- "{\*\bkmkstart TagAmountDigits}"
- "({\*\bkmkstart TagAmountText}"
- "{\*\bkmkstart ypQVK]b[,k`}"
Non-match examples:
- "{\*\bkmkend TagAmountText}"
- "{\*\bkmkend fadsfqf}"
Regular expression: \{\\\*\\bkmkstart\s(.*?)\}
returns string between two quotes
Match examples:
- "Return Parent.DB.GetDataReader("CauseImmediateGet", MyIncidentEventTypeID)"
- ""fadsfds""
- ""fwubeh98hu"h9io"
Non-match examples:
- "Return Parent.DB.GetDataReader(CauseImmediateGet", MyIncidentEventTypeID)"
- "fewf"Fsdf"
Regular expression: "[^"\r\n]*"
Airway bill No. that allows only the format 999-99999998 and does not allow the last digit to be 7,8,9.
Match examples:
- "999-99999995"
- "123-47859683"
- "156-78965422"
Non-match examples:
- "123-47859689"
- "9999999999"
Regular expression: ^\d{3}-\d{7}[0-6]{1}$
Positive real number greater than zero.
Match examples:
- "0.01"
- "010001.011010"
- ".234"
Non-match examples:
- "0.00 OR ."
- "010001.011010E"
Regular expression: (^[0-9]*[1-9]+[0-9]*\.[0-9]*$)|(^[0-9]*\.[0-9]*[1-9]+[0-9]*$)|(^[0-9]*[1-9]+[0-9]*$)
Matches valids TCP/IP-Adresses.
Match examples:
- "1.198.0.1"
- "100.10.0.1"
- "200.200.123.123"
Non-match examples:
- "..12.23"
- "a.23.345"
Regular expression: ^((\d|\d\d|[0-1]\d\d|2[0-4]\d|25[0-5])\.(\d|\d\d|[0-1]\d\d|2[0-4]\d|25[0-5])\.(\d|\d\d|[0-1]\d\d|2[0-4]\d|25[0-5])\.(\d|\d\d|[0-1]\d\d|2[0-4]\d|25[0-5]))$
MM/dd/yyyy with 100% leap years. Valid since year 1900.
MM and DD could have 1 or 2 digits : M/d/yyyy or MM/d/yyyy or M/dd/yyyy
Match examples:
- "01/31/1905"
- "1/9/1900"
- "2/29/1904"
Non-match examples:
- "31/01/2005"
- "02/29/2005"
Regular expression: ^(((0?[1-9]|1[012])/(0?[1-9]|1\d|2[0-8])|(0?[13456789]|1[012])/(29|30)|(0?[13578]|1[02])/31)/(19|[2-9]\d)\d{2}|0?2/29/((19|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00)))$
Regular expression to limit types of files accepted. This example matches .jpg and .gif files only.
Match examples:
- "filename.jpg"
- "FileName.JPG"
- "filename.gif"
Non-match examples:
- "filename.png"
- "filename.xxx"
Regular expression: ^([a-zA-Z].*|[1-9].*)\.(((j|J)(p|P)(g|G))|((g|G)(i|I)(f|F)))$
Allows for a dollar sign with no space after, a dollar sign with a space after, and no dollar sign. Also makes sure theres no more than 4 decimal places. Takes out leading zeros if the number isn't 0, and protects against blank entries.
Match examples:
- "$ 123.4"
- "$00.5"
- "200,000"
Non-match examples:
- "$012,234.44"
- "-39.05"
Regular expression: ^(\$\ |\$)?((0|00|[1-9]\d*|([1-9]\d{0,2}(\,\d{3})*))(\.\d{1,4})?|(\.\d{1,4}))$
Simple Microsoft product key check.
Match examples:
- "12345-12345-12345-12345-12345"
- "ABCDE-ABCDE-ABCDE-ABCDE-ABCDE"
- "AB5DE-AB5DE-AB5DE-AB5DE-AB5DE"
Non-match examples:
- "12345-123-123456-12345"
- "ABC-ABCDEF-ABCDE-ABCDE"
Regular expression: ^[A-Z1-9]{5}-[A-Z1-9]{5}-[A-Z1-9]{5}-[A-Z1-9]{5}-[A-Z1-9]{5}$
Can be used to match on (and strip out) low-order non-printable ASCII characters (ASCII 0-31) from string data prior to adding to an XML document. Useful when using parsers like Microsoft's MSXML3 that strictly enforce W3C specification on allowable characters. Does not match on ASCII 9 (horiz tab), 10 (carriage return), 13 (line feed).
Match examples:
- "&amp;#x2;"
- "&amp;#x001F;"
- "&amp;#x0000000000000000000000000000000000000001B;"
Non-match examples:
- "&amp;#x0020;"
- "&amp;#xDFFF;"
Regular expression: &amp;\#x0*(0|1|2|3|4|5|6|7|8|B|C|E|F|10|11|12|13|14|15|16|17|18|19|1A|1B|1C|1D|1E|1F);
The provided regex pattern appears to match strings that represent either a Danish CPR number (with or without separators) or a 14-digit numeric string, depending on the format.
Match examples:
- "00.000.000/0000-00"
- "123.456.789-98"
- "12345678901234"
Non-match examples:
- "12.123.123.0001.12"
- "123.456.789.89"
Regular expression: (^(\d{2}.\d{3}.\d{3}/\d{4}-\d{2})|(\d{14})$)|(^(\d{3}.\d{3}.\d{3}-\d{2})|(\d{11})$)
allow only positive numbers with two decimal places
Match examples:
- "12.56"
- "0.25"
- "156.56"
Non-match examples:
- "-123.45"
- "1.023"
Regular expression: (^\d*\.\d{2}$)
Validate location, latitude and longitude separated by space, where latitude is expressed as compass direction (N or S),degrees,minutes,seconds and longitude is expressed as compassdirection (E or W) ,degrees,minutes,seconds.
Range check for minutes and seconds (0-59),
max.latitude 90.00.00, max longitude 180.00.00
Match examples:
- "N90.00.00 E180.00.00"
- "S34.59.33 W179.59.59"
- "N00.00.00 W000.00.00"
Non-match examples:
- "N91.00.00 E181.00.00"
- "Z34.59.33 W179.59.59"
Regular expression: ^[NS]([0-8][0-9](\.[0-5]\d){2}|90(\.00){2})\040[EW]((0\d\d|1[0-7]\d)(\.[0-5]\d){2}|180(\.00){2})$
Matches /* style comments */.
Matches whitespace (so can detect tabs, etc.)
Match examples:
- "/* CSS comments */"
- "/* multi-line SQL/CSS/Etc comments */"
- "/*2fsdffd*/"
Non-match examples:
- "&lt;!-- doesn't match --&gt;"
- "-- won't match and //won't match"
Regular expression: /\*((?!\*/)[\d\D\s])*\*/
Port Numbers: Well Known Ports: 0 through 1023. Matches numbers in range of 0 through 1023.
Match examples:
- "0"
- "123"
- "1023"
Non-match examples:
- "1024"
- "9999"
Regular expression: ^(102[0-3]|10[0-1]\d|[1-9][0-9]{0,2}|0)$
Port Numbers: Registered Ports: 1024 through 49151. Matches numbers in range of 1024 through 49151.
Match examples:
- "1024"
- "49151"
- "30100"
Non-match examples:
- "1023"
- "49152"
Regular expression: ^(4915[0-1]|491[0-4]\d|490\d\d|4[0-8]\d{3}|[1-3]\d{4}|[2-9]\d{3}|1[1-9]\d{2}|10[3-9]\d|102[4-9])$
Port Numbers: Dynamic and/or Private Ports: 49152 through 65535. Matches numbers in range of 49152 through 65535.
Match examples:
- "49152"
- "65535"
- "50000"
Non-match examples:
- "49151"
- "65536"
Regular expression: ^(6553[0-5]|655[0-2]\d|65[0-4]\d\d|6[0-4]\d{3}|5\d{4}|49[2-9]\d\d|491[6-9]\d|4915[2-9])$
Port Numbers: Well Known Ports &amp; Registered Ports: 0 through 49151. Matches numbers in range of 0 through 49151.
Match examples:
- "0"
- "1023"
- "49151"
Non-match examples:
- "49152"
- "50000"
Regular expression: ^(4915[0-1]|491[0-4]\d|490\d\d|4[0-8]\d{3}|[1-3]\d{4}|[1-9]\d{0,3}|0)$
Port Numbers: Well Known Ports, Registered Ports &amp; Dynamic and/or Private Ports: 0 through 65536. Matches numbers in range of 0 through 65536.
Match examples:
- "1023"
- "49151"
- "65535"
Non-match examples:
- "65536"
- "66000"
Regular expression: ^(6553[0-5]|655[0-2]\d|65[0-4]\d\d|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)$
Good For Validating Phone numbers that are 0 to 9 in length
Match examples:
- "123456"
- "12354"
- "456443"
Non-match examples:
- "456abcd"
- "894561845684561"
Regular expression: (^[0-9]{0,10}$)
This pattern will match any multi-line or single line comments in TSQL (Stored Procedures or SPROC's) in MS SQL Server.
Match examples:
- "/* My Comment */"
- "-- A single line comment"
- "-- 78BHUJN"
Non-match examples:
- "*/ Won't work /*"
- "// Not likely"
Regular expression: (\/\*(\s*|.*?)*\*\/)|(--.*)
US vehicle VIN numbers for vehicles with GVW &lt; 10k lbs
Match examples:
- "WDBCA45EXKA478654"
- "X7PFG20Y1TD761390"
- "HSCKU35F3RKV57445"
Non-match examples:
- "WDBCA45EXKA47865a"
- "E:\DyAGT\SD01A_specV2.jpg"
Regular expression: ^([A-Z\d]{3})[A-Z]{2}\d{2}([A-Z\d]{1})([X\d]{1})([A-Z\d]{3})\d{5}$
It could be used to validate local as well as International Phone nos where the number my be preceeding by + sign for(00) and may have brackets to accept the city code like (22).It will also accept space in between like 001 116 23314. Match strings that consist of a combination of digits, plus signs (+), parentheses (), spaces, and commas. The pattern allows for at least one character from this set, followed by zero or more comma-separated groups of one or more digits.
Match examples:
- "0091(22) 31544"
- "+1 (116) 23314"
- "+91(22)311545"
Non-match examples:
- "91 (22) abc21"
- "+91 (abc) 23321"
Regular expression: ^[0-9,+,(), ,]{1,}(,[0-9]+){0,}$
Match strings of any characters (including letters, digits, symbols, and whitespace) that are between 0 and 20 characters in length.
Match examples:
- "I match"
- "I match 2"
- "7FGY8HU9JI"
Non-match examples:
- "hey I don't match at all"
- "hey I don't matc54fdsdh at all"
Regular expression: ^(.){0,20}$
validates a simple ip v4 address. including 0.0.0.0 or 255.255.255.255. leading 0 is and numbers above 255 are forbidden.
Match examples:
- "0.0.0.0"
- "255.255.255.255"
- "168.129.2.255"
Non-match examples:
- "02.234.2.1"
- "168.192.0.256"
Regular expression: ^((\d|[1-9]\d|2[0-4]\d|25[0-5]|1\d\d)(?:\.(\d|[1-9]\d|2[0-4]\d|25[0-5]|1\d\d)){3})$
Allows only positive numbers, greater than zero
Match examples:
- "1"
- "10"
- "135"
Non-match examples:
- "0"
- "-1"
Regular expression: ^[1-9]+[0-9]*$
This expression was originally developed for user names. Matching text must have 6 - 50 characters, cannot contain spaces, must begin with an alpha character, can contain mixed case alpha, digits, and the following special characters:
! @ # $ % ^ &amp; * - . _ ?
Match examples:
- "aB!@#%&amp;^$.?*-0123456789Yz"
- "user@somedomain.com"
- "Excla!Us_er"
Non-match examples:
- "1234567890"
- "aB1()[]{};:'&quot;,&lt;&gt;/\_=0Yz"
Regular expression: (?=^.{6,51}$)([A-Za-z]{1})([A-Za-z0-9!@#$%_\^\&amp;\*\-\.\?]{5,49})$
This pattern will match 1 instance of a NON-alphanumeric character. This is very handy to use when you want to filter input only by alphanumeric characters.
Match examples:
- "Test!"
- "This will match"
- "H3llo$"
Non-match examples:
- "Test"
- "Thiswillnotmatch"
Regular expression: ([^a-zA-Z0-9])