RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 68 regular expressions found.

Change page:   |    Displaying page 1 of 4 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
^[0,1]?\d{1}\/(([0-2]?\d{1})|([3][0,1]{1}))\/(([1]{1}[9]{1}[9]{1}\d{1})|([2-9]{1}\d{3}))$
Description
This expression checks the validity of a date (US, but it is easily editable for other format's). Year's 1990-9999, Month's 1 or 01 to 12, Day's 1 or 01 to 31. Still needs to have individual months added (i.e., Feb's 28 days), and some how to check for leap year...the months issue should not be to hard, but the leap year seems like a real chore. Please let me know if you have any suggestions for leap year.
Matches
01/01/1990 | 12/12/9999 | 3/28/2001
Non-Matches
3-8-01 | 13/32/1001 | 03/32/1989
Author Rating: The rating for this expression. Scott Watermasysk
Title Test Details Pattern Title
Expression
^.+@[^\.].*\.[a-z]{2,}$
Description
Most email validation regexps are outdated and ignore the fact that domain names can contain any foreign character these days, as well as the fact that anything before @ is acceptable. The only roman alphabet restriction is in the TLD, which for a long time has been more than 2 or 3 chars (.museum, .aero, .info). The only dot restriction is that . cannot be placed directly after @. This pattern captures any valid, reallife email adress.
Matches
Non-Matches
Author Rating: The rating for this expression. Thor Larholm
Title Test Details Pattern Title
Expression
^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$
Description
It verifies that: - Only letters, numbers and email acceptable symbols (+, _, -, .) are allowed - No two different symbols may follow each other - Cannot begin with a symbol - Ending domain must be at least 2 letters - Supports subdomains - TLD must be between 2 and 6 letters (Ex: .ca, .museum) - Only (-) and (.) symbols are allowed in domain, but not consecutively. Problems: See comments below
Matches
Non-Matches
Author Rating: The rating for this expression. Gavin Sharp
Title Test Details Pattern Title
Expression
^([a-zA-Z0-9!@#$%^&*()-_=+;:'"|~`<>?/{}]{1,5})$
Description
This Regular expression validates a string that contains all printable characters with a minimum length of 1 and maximum length of 5. Obviously the min and max can be changed to meet the users needs. ^([a-zA-Z0-9!@#$%^&*()-_=+;:'"|~`<>?/{}]{1,5})$ This is the string, I keep getting &lt and other characters when I save it.
Matches
ilove | $%*!_ | it
Non-Matches
123456 | This is great
Author Rating: Not yet rated. Michael Matusiewicz
Title Test Details Pattern Title
Expression
^((Bob)|(John)|(Mary)).*$(?<!White)
Description
&quot;Starts with but does not end with.&quot; I needed a pattern to require certain first (and optional middle) names, but to fail for certain last names. So if Bob, John, and Mary are acceptable first names but the White's are always rejected then...
Matches
Bob Jones | John Smith | Mary Jane Smith
Non-Matches
Bob White | Mary Doe White | Gina Smith
Author Rating: Not yet rated. Eli Robillard
Title Test Details Pattern Title
Expression
^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$
Description
US Phone Number: This regular expression for US phone numbers conforms to NANP A-digit and D-digit requirments (ANN-DNN-NNNN). Area Codes 001-199 are not permitted; Central Office Codes 001-199 are not permitted. Format validation accepts 10-digits without delimiters, optional parens on area code, and optional spaces or dashes between area code, central office code and station code. Acceptable formats include 2225551212, 222 555 1212, 222-555-1212, (222) 555 1212, (222) 555-1212, etc. You can add/remove formatting options to meet your needs.
Matches
5305551212 | (530) 555-1212 | 530-555-1212
Non-Matches
0010011212 | 1991991212 | 123) not-good
Author Rating: The rating for this expression. Don Johnston
Title Test Details Pattern Title
Expression
^([A-Za-z0-9]\s?)+([,]\s?([A-Za-z0-9]\s?)+)*$
Description
This regular expression can be used to parse a comma delimited string. Leading whitespaces (at the beginning of the entire string) and ending commas are not acceptable. Any combination of letters and numbers with zero or one white space between them are acceptable. Note: To change the delimiter, simply replace the comma in the square brackets to the delimiter of choice.
Matches
123, 4567, 8901 | abc, defghi, jklmn | abc123
Non-Matches
abc123 | abc123, | ,abc123
Author Rating: The rating for this expression. Rehan Azam
Title Test Details Pattern Title
Expression
^[a-zA-Z]+((\s|\-)[a-zA-Z]+)?$
Description
This regex validates a persons first name. Acceptable names include compound names with a hyphen or a space in them.
Matches
Bobbie Sue | Ana-Claire | BobbyJoe
Non-Matches
Billy - Joe | Billy Jr. | Thos.
Author Rating: Not yet rated. s l
Title Test Details Pattern Title
Expression
^[a-zA-Z]+((((\-)|(\s))[a-zA-Z]+)?(,(\s)?(((j|J)|(s|S))(r|R)(\.)?|II|III|IV))?)?$
Description
This regex validates a persons last name. Acceptable names can include compound names seperated by a hyphen or a space.
Matches
Jones, Jr | Casey-Jones | Casey-Jones, IV
Non-Matches
Jones, IV. | Jones , Jr | Casey-Jones-Hall
Author Rating: Not yet rated. s l
Title Test Details Pattern Title
Expression
^(19[0-9]{2}|[2-9][0-9]{3})-((0(1|3|5|7|8)|10|12)-(0[1-9]|1[0-9]|2[0-9]|3[0-1])|(0(4|6|9)|11)-(0[1-9]|1[0-9]|2[0-9]|30)|(02)-(0[1-9]|1[0-9]|2[0-9]))\x20(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$
Description
Checks for the format yyyy-MM-dd HH:mm:ss also known as SortableDateTimePattern (conforms to ISO 8601) using local time. From 1900-01-01 00:00:00 to 9999-12-31 23:59:59. No check for leap year.
Matches
2004-07-12 14:25:59 | 1900-01-01 00:00:00 | 9999-12-31 23:59:59
Non-Matches
04-07-12 14:25:59 | 20004-07-12 14:25 | 2004/07/12 14:25:59
Author Rating: The rating for this expression. Jens Ulrik Jacobsen
Title Test Details Pattern Title
Expression
^[a-zA-Z_]{1}[a-zA-Z0-9_@$#]*$
Description
This Regex matches valid SQL identifiers, including names for Stored Procedures and the like. Note that local variables/parameters (which begin with an &quot;@&quot;) will not match this Regex, nor will temporary objects (beginning with a &quot;#&quot;), or global temporary objects (beginning with &quot;##&quot;). All other valid identifiers/variables/table names/stored procedure names/columns etc., will match. Please let me know if you find this useful or have any complaints - [email protected].
Matches
upApplicationReadContacts | _Application_ReadContacts | a_45$#z
Non-Matches
upApplication ReadContacts | $Application_ReadContacts | a_45%$#z
Author Rating: The rating for this expression. Geoff Williams
Title Test Details Pattern Title
Expression
&lt;\s*a\s[^&gt;]*\bhref\s*=\s* ('(?&lt;url&gt;[^']*)'|&quot;&quot;(?&lt;url&gt;[^&quot;&quot;]*)&quot;&quot;|(?&lt;url&gt;\S*))[^&gt;]*&gt; (?&lt;body&gt;(.|\s)*?)&lt;\s*/a\s*&gt;
Description
Suitable for extraction of all hyperlinks in the format: &lt;a ... href=&quot;...&quot; ...&gt; some text &lt;/a&gt; from a text document. Separates in groups the components of the links (url and body).
Matches
&lt;a href=&quot;javascript:'window.close()'&quot;&gt;close the window&lt;/a&gt; | &lt;a target=&quo
Non-Matches
&lt;aa href=&quot;test.htm&quot;&gt;test&lt;/a&gt; | &lt; a href hr = 'http://www.nakov.com'&gt;...&
Author Rating: The rating for this expression. Svetlin Nakov
Title Test Details Pattern Title
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);
Description
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).
Matches
&amp;#x2; | &amp;#x001F;
Non-Matches
&amp;#x0020; | &amp;#xDFFF;
Author Rating: Not yet rated. Matt Skone
Title Test Details Pattern Title
Expression
(.*\.jpe?g|.*\.JPE?G)
Description
I just couldn't find any simple expression to check if an entered value is a jp(e)g. If you're using this to check for e.g. mp3, just use the following: (.*\mp3|.*\.MP3) This expression is not really stable, cause it will also match file.jpg.mp3 or stuff like that.
Matches
*.JPG | *.jpeg
Non-Matches
.gif
Author Rating: The rating for this expression. N Verlaan
Title Test Details Pattern Title
Expression
&lt;table&gt;(&lt;tr&gt;((&lt;td&gt;([A-Za-z0-9])*&lt;/td&gt;)+)&lt;/tr&gt;)*&lt;/table&gt;
Description
This accepts html's tables, with rows and colums. Acepta tablas Html, con sus respectivas filas y columnas.
Matches
&lt;table&gt;&lt;tr&gt;&lt;td&gt;Hello&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; | &lt;table&gt;&lt;/table
Non-Matches
&lt;table&gt;&lt;tr&gt;&lt;/tr&gt;
Author Rating: Not yet rated. Isaac Triguero Velázquez
Title Test Details URL Test
Expression
(?#WebOrIP)((?#protocol)((http|https):\/\/)?(?#subDomain)(([a-zA-Z0-9]+\.(?#domain)[a-zA-Z0-9\-]+(?#TLD)(\.[a-zA-Z]+){1,2})|(?#IPAddress)((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])))+(?#Port)(:[1-9][0-9]*)?)+(?#Path)((\/((?#dirOrFileName)[a-zA-Z0-9_\-\%\~\+]+)?)*)?(?#extension)(\.([a-zA-Z0-9_]+))?(?#parameters)(\?([a-zA-Z0-9_\-]+\=[a-z-A-Z0-9_\-\%\~\+]+)?(?#additionalParameters)(\&([a-zA-Z0-9_\-]+\=[a-z-A-Z0-9_\-\%\~\+]+)?)*)?
Description
I needed a regex for validating URLs, couldn't find a suitable one, so wrote this, with comments! It matches any valid web URL (Address or IP, with or without protocol), including optional port number, directory path, filname.extension and any paramater pairs. Hope it helps, even if just to understand expressions easier!
Matches
www.test.com|http://www.test.com|234.232.12.23:8080|sub.test.com/dir/file.ext?param=val&param2=val2
Non-Matches
/file.htm|256.0.0.0
Author Rating: The rating for this expression. David Barker
Title Test Details Chemical Elements symbols
Expression
^((?-i)A[cglmrstu]|B[aehikr]?|C[adeflmorsu]?|D[bsy]|E[rsu]|F[emf]?|G[ade]|H[efgos]?|I[nk]?|Kr?|L[airu]|M[dgnot]|N[abdeiop]|Os?|P[abdmortu]?|R[abefghnu]|S[bcegimnr]?|T[abcehil]|U(u[bhopqst])?|V|W|Xe|Yb?|Z[nr])$
Description
Chemical elements of the periodic table from 1 to 118.
Matches
Hg
Non-Matches
HE
Author Rating: Not yet rated. Guy Bruneau
Title Test Details IP Tables
Expression
^(?<Date>.+\s\d+\s\d+\:\d+\:\d+).+\:.+\:(?<Traffic>.+)\:(?<Rule>.+)\:IN\=(?<InboundInterface>.+)\sOUT\=(?<OutboundIntercace>.*?)\s(?:MAC\=(?<MacAddress>.+)\s|)SRC\=(?<Source>.+)\sDST\=(?<Destination>.+)\sLEN\=.+TOS\=.+PROTO\=(?<Protocol>.+)\sSPT\=(?<SourcePort>.+)\sDPT\=(?<DestinationPort>.+)\s.+$
Description
The goal of my regular expression is to allow me to break apart IP Table log files so that I can build a basic web front-end to allow me to view the traffic on the network. The MAC address is optional, because the way that this firewall works, is by providing the MAC address when the outbound address is not available.
Matches
Jul 20 13:05:08 123.123.123.123 kernel: Shorewall:loc2net:REJECT:IN=eth0 OUT=eth1 SRC=444.333.222.111 DST=111.222.333.444 LEN=59 TOS=0x00 PREC=0x00 TTL=127 ID=12267 PROTO=UDP SPT=2121 DPT=53 LEN=39
Non-Matches
Anything Else
Author Rating: The rating for this expression. Sean McIlvenna
Title Test Details A Forgiving US Phone Number
Expression
^(1?)(-| ?)(\()?([0-9]{3})(\)|-| |\)-|\) )?([0-9]{3})(-| )?([0-9]{4}|[0-9]{4})$
Description
This is a fairly forgiving phone number match. It's original purpose was to extract phone numbers from the details field in our database and into their own phone number table. It worked brilliantly. Enjoy!
Matches
14165551212, 4165551212, (416)5551212, 416 555 1212, 416-555-1212, (416)-555-1212, (416) 555 1212, 1-900-888-1212
Non-Matches
456-444-45464, 416-SEX-POOP, 4!6-777-#232
Author Rating: The rating for this expression. Doug Jones
Title Test Details Private IP address
Expression
(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^127\.0\.0\.1)
Description
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. ***Importnat*** This pattern assumes that the input is a valid IP address. You many need to make sure the input is a valid IP address.
Matches
10.12.0.19 | 172.21.0.23 | 192.168.0.2
Non-Matches
222.12.3.24 | 172.12.0.12
Author Rating: Not yet rated. Mahesh Ramakrishnan
Change page:   |    Displaying page 1 of 4 pages; Items 1 to 20

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials