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

Please support RegExLib Sponsors

Hosting Spotlight

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 1996 regular expressions found.

Change page:   |    Displaying page 1 of 100 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
([\d\w-.]+?\.(a[cdefgilmnoqrstuwz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmnoz]|e[ceghrst]|f[ijkmnor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eouw]|s[abcdeghijklmnortuvyz]|t[cdfghjkmnoprtvwz]|u[augkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw]|aero|arpa|biz|com|coop|edu|info|int|gov|mil|museum|name|net|org|pro)(\b|\W(?<!&|=)(?!\.\s|\.{3}).*?))(\s|$)
Description
This will find URLs in plain text. With or without protocol. It matches against all toplevel domains to find the URL in the text.
Matches
http://www.website.com/index.html | www.website.com | website.com
Non-Matches
Works in all my tests. Does not capture protocol.
Author Rating: The rating for this expression. James Johnston
Title Test Details Pattern Title
Expression
&lt;a\s*href=(.*?)[\s|&gt;]
Description
Retrieves all anchor links in a html document, useful for spidering. You will need to do a replace of &quot; and ' after the regular expression, as the expression gets all links. As far as I know there is no way, even with \1 groupings, of getting a condition on whether the link contains a &quot;,' or nothing at all (&quot; and ' is easy enough, but what happens if the link starts with &quot;, and has a javascript function call with a string in it). If there is, it's probably quicker to do it like this and do a string replace anyway.
Matches
&lt;a href=&quot;http://www.blah.com&quot;&gt; | &lt;a href='../blah.html' target=&quot;_top&quot;&a
Non-Matches
&lt;a href = http://www.idiothtmlprogrammers.com &gt;
Author Rating: The rating for this expression. chris s
Title Test Details Date Match
Expression
^(d{0}|(31(?!(FEB|APR|JUN|SEP|NOV)))|((30|29)(?!FEB))|(29(?=FEB(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(29(?=FEB(((0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|1\d|2[0-8])(JAN|FEB|MAR|MAY|APR|JUL|JUN|AUG|OCT|SEP|NOV|DEC)((1[6-9]|[2-9]\d)\d{2}|\d{2}|d{0})$
Description
This pattern mathces the following date formats: DDMMMYY,DDMMMYYYY,DDMMMYY. The Pattern matches on leap year dates as well
Matches
12MAR02 | 12MAR2008 | 29FEB2008 | 12MAR
Non-Matches
29FEB2007 | 32MAR | 00APR
Author Rating: Not yet rated. Ole
Title Test Details Pattern Title
Expression
^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$
Description
Used to validate Credit Card numbers, Checks if it contains 16 numbers in groups of 4 separated by -, ,or nothing
Matches
1111-2323-2312-3434 | 1234343425262837 | 1111 2323 2312 3434
Non-Matches
1111 2323 2312-3434 | 34323423 | 1111-2323-23122-3434
Author Rating: The rating for this expression. Sachin Bhatt
Title Test Details Pattern Title
Expression
^([a-zA-Z '-]+)$
Description
Check if the text is a valid firstname or lastname.It allows Characters,'- and space only
Matches
Sachin Bhatt | D'Souza | Ul-Haq
Non-Matches
sac2hin | sc*&amp; | sac)in
Author Rating: The rating for this expression. Sachin Bhatt
Title Test Details AW Short Coordinate
Expression
^[0-9]+[NnSs] [0-9]+[WwEe]$
Description
This tests, are entered AW coordinates in correct short format, and it has no world info
Matches
0N 0W
Non-Matches
aw 0N 0W
Author Rating: The rating for this expression. Slysoft
Title Test Details Pattern Title
Expression
(?s)( class=\w+(?=([^&lt;]*&gt;)))|(&lt;!--\[if.*?&lt;!\[endif\]--&gt;)|(&lt;!\[if !\w+\]&gt;)|(&lt;!\[endif\]&gt;)|(&lt;o:p&gt;[^&lt;]*&lt;/o:p&gt;)|(&lt;span[^&gt;]*&gt;)|(&lt;/span&gt;)|(font-family:[^&gt;]*[;'])|(font-size:[^&gt;]*[;'])(?-s)
Description
Word HTML cleanup code. Use this expression to get rid of most of the stuff that Word adds to an HTML document such as: lots of span elements, font-family and font-size style attributes, class attributes, a whole bunch of if-then statements. Use this expression in a regex.replace(originalHtml, regExpr, &quot;&quot;).
Matches
&lt;span&gt;
Non-Matches
&lt;table&gt;
Author Rating: The rating for this expression. Peter Donker
Title Test Details Pattern Title
Expression
^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*.*))+\.((html|HTML)|(htm|HTM))$
Description
Path of files HTML and HTM
Matches
c:\arquivo.html | \\home\arquivo232.HTML | Z:\teste.htm
Non-Matches
c:\arquivo.png | arquivo232.HTML | Z:\teste
Author Rating: The rating for this expression. Diego Siebra Ferreira
Title Test Details Pattern Title
Expression
^(?=.*[0-9]+.*)(?=.*[a-zA-Z]+.*)[0-9a-zA-Z]{6,}$
Description
Password must contain at least one letter, at least one number, and be longer than six charaters.
Matches
a1b2c3 | abcdefg123 | 12345a
Non-Matches
abcdefghij | 1234567890
Author Rating: The rating for this expression. Eric Miller
Title Test Details Pattern Title
Expression
^((?-i:0x)?[A-Fa-f0-9]{32}| [A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}| \{[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}\})$
Description
Validates a GUID/UUID, without capture, to the following patterns: [{hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh}], [hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh],[hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh],[0xhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh], where 'h' is a valid hex character. This last pattern is a binary format commonly used with SQL Server 2000. It allows you to use binary(n) and varbinary(n) parameters that convert well to unique identifier. Please note that this is not case sensitive EXCEPT the 'x' in the binary pattern. It must be lower case.
Matches
6F9619FF-8B86-D011-B42D-00C04FC964FF | 0x6F9619FF8B86D011B42D00C04FC964FF | {6F9619FF-8B86-D011-B42D
Non-Matches
{6F9619FF8B86D011B42D00C04FC964FF} | 0X6F9619FF8B86D011B42D00C04FC964FF
Author Rating: Not yet rated. Patrick Fogarty
Title Test Details Pattern Title
Expression
^[\w\.=-]+@[\w\.-]+\.[\w]{2,3}$
Description
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.
Matches
a@a.com | a@a.com.au | a@a.au
Non-Matches
word | word@ | @word
Author Rating: The rating for this expression. Gregory Beamer
Title Test Details Pattern Title
Expression
/[^/]+$
Description
Very easy expression to get the file name from a path. I couldn't find it so I wrote it and now I post it here! Hope it could help.
Matches
/home/pietro/myfile.txt | /home/pietro/myfile
Non-Matches
/home/pietro/mydir/
Author Rating: The rating for this expression. Pietro Bonfa
Title Test Details Script Block Parser
Expression
<script(?:(?:.*(?<src>(?<=src=")[^"]*(?="))[^>]*)|[^>]*)>(?<content>(?:(?:\n|.)(?!(?:\n|.)<script))*)</script>
Description
This one enables you to parse well-formed script tags to get both the src value and the block content, if specified. I'm using this one in some AJAX where I get script blocks back in a text reponse and need to parse them and add them to the DOM so they get processed.
Matches
<script type="text/javascript" src="Test.js"></script>
Non-Matches
<script src=Test.js></script>
Author Rating: The rating for this expression. Ambrose
Title Test Details Pattern Title
Expression
^[A-Za-z]{1,2}[\d]{1,2}([A-Za-z])?\s?[\d][A-Za-z]{2}$
Description
UK Postal Codes - The code is normally written in capital letters with a space between the outer and inner parts; it is understandable if the space is omitted. This regular expression validates upper or lower case with or without the space:
Matches
CF1 2AA | cf564fg
Non-Matches
a1234d | A12 77Y
Author Rating: The rating for this expression. Scott Pite
Title Test Details Pattern Title
Expression
^(?=[^&])(?:(?<scheme>[^:/?#]+):)?(?://(?<authority>[^/?#]*))?(?<path>[^?#]*)(?:\?(?<query>[^#]*))?(?:#(?<fragment>.*))?
Description
Use it for breaking-down a URI (URL, URN) reference into its main components: Scheme, Authority, Path, Query and Fragment. This is not a simple match regular expression. so it not works to verify a URI. It returns 1 matching group for each URI component. For example, for the following URI: http://regexlib.com/REDetails.aspx?regexp_id=x#Details returns: scheme=&quot;http&quot;, authority=&quot;regexlib.com&quot;, path=&quot;/REDetails.aspx&quot;, query=&quot;regexp_id=x&quot; and fragment=&quot;Details&quot;. This is a W3C raccomandation (RFC 2396).
Matches
http://regexlib.com/REDetails.aspx?regexp_id=x#Details
Non-Matches
&
Author Rating: The rating for this expression. Frederico Knabben
Title Test Details Duration time
Expression
^[0-9]+\.?[0-9]?[0-9]?[0,5]?$
Description
The time should be fractional number and divisible by 0.005
Matches
1.005 | 60 | 0.08
Non-Matches
1.009 | -8 | .005
Author Rating: Not yet rated. Skoblin Ilya
Title Test Details Pattern Title
Expression
^[1-9][0-9]{3}\s?[a-zA-Z]{2}$
Description
Validates Dutch Postal Codes (ZipCode). There was a previous one listed here, but it's not entirely correct. Namely that dutch postal codes can contain a zero but cannot start with one, so this one is the adjusted version.
Matches
1234AB | 1234 AB | 1001 AB
Non-Matches
0123AB | 1234A B | 0123 AB
Author Rating: The rating for this expression. Jos Krause
Title Test Details Pattern Title
Expression
^[\u0081-\uFFFF]{1,}$
Description
Double byte charactors validator. The rule applies to double byte charactor input validation.
Matches
??? | ????
Non-Matches
ABC | ;&amp;#F;
Author Rating: Not yet rated. Max Lu
Title Test Details Pattern Title
Expression
^([GB])*(([1-9]\d{8})|([1-9]\d{11}))$
Description
Simple check of valid UK VAT Registration numbers. The standard format for UK VAT number must be 9 characters long or 12 characters if a branch trader. The GB prefix has been included as optional, but technically you should include it. The UK VAT format also includes Government Departments and Health Authorities, but I have excluded them for the moment.
Matches
123456789 | GB123456789 | GB123456789123
Non-Matches
dfddf | 3443443 | 34 34 3344
Author Rating: The rating for this expression. Ben Powell
Title Test Details Pattern Title
Expression
^\+?972(\-)?0?[23489]{1}(\-)?[^0\D]{1}\d{6}$
Description
Matches an israely phone number with country code. With or without the plus sign. Also allows two or one digit in city code. Checks for a valid city code (02,03,04,08,09)
Matches
+972-4-8253055 | 972-4-8615466 | 972-04-8564521
Non-Matches
04-5487665 | 05-455665545 | 456884624
Author Rating: The rating for this expression. Alex Hazanov
Change page:   |    Displaying page 1 of 100 pages; Items 1 to 20

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