Displaying page
of
pages;
Items to
| 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:
James Johnston
|
| Title |
Test
Details
Pattern Title
|
| Expression |
<a\s*href=(.*?)[\s|>] |
| Description |
Retrieves all anchor links in a html document, useful for spidering. You will need to do a replace of " 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 ",' or nothing at all (" and ' is easy enough, but what happens if the link starts with ", 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 |
<a href="http://www.blah.com"> | <a href='../blah.html' target="_top"&a |
| Non-Matches |
<a href = http://www.idiothtmlprogrammers.com > |
| Author |
Rating:
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
Scientific Notation
|
| Expression |
^(-?[1-9](\.\d+)?)((\s?[X*]\s?10[E^]([+-]?\d+))|(E([+-]?\d+)))$ |
| Description |
Matches both normalized and E notations, with or without spaces or negative numbers. Make sure to use a case insensitive pattern matcher. Group 1 is the significand, and either group 5 or group 7 is the exponent (one or the other will be null, but never both). |
| Matches |
1.1 x 10^9 | 2.34 X 10^12 | 3.14159 * 10^30 | 1.1x10^9 | 2.34X10^12 | 3.14159*10^30 | 1.1 x 10e9 | 2.34 x 10E12 | 3.14159e30 | 1.1 x 10^-9 | 2.34 X 10^-12 | 3.14159E-30 | -1.1 x 10^9 | -2.34 X 10E12 | -3.14159 * 10e30 | -1.1x10^-9 | -2.34E-12 | -3.14159e-30 | 3.1459E+030 | 1x10^9 | 1E9 |
| Non-Matches |
0.1 x 10^9 | 23.4 x 10^12 | 3.14159 * 10e^30 | 1.1e8.3 |
| Author |
Rating:
Not yet rated.
Jared Cook
|
| 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:
Not yet rated.
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*& | sac)in |
| Author |
Rating:
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:
Slysoft
|
| Title |
Test
Details
Allow Decimal only
|
| Expression |
^\d*[0-9](|.\d*[0-9]|)*$ |
| Description |
Decimal like 123.23
123.1234
12345.456 |
| Matches |
123.23 | 123.1234 | 1234 | 1234.456 |
| Non-Matches |
123a.12 | 123.34d | abc |
| Author |
Rating:
Gyanendra
|
| Title |
Test
Details
Pattern Title
|
| Expression |
(?s)( class=\w+(?=([^<]*>)))|(<!--\[if.*?<!\[endif\]-->)|(<!\[if !\w+\]>)|(<!\[endif\]>)|(<o:p>[^<]*</o:p>)|(<span[^>]*>)|(</span>)|(font-family:[^>]*[;'])|(font-size:[^>]*[;'])(?-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, "").
|
| Matches |
<span> |
| Non-Matches |
<table> |
| Author |
Rating:
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:
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:
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:
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:
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:
Ambrose
|
| Title |
Test
Details
Swedish personnummer with accepted foreigners
|
| Expression |
^[0-9]{6}-[0-9pPtTfF][0-9]{3}$ |
| Description |
Other Swedish personnummer regexps do not take into account that at Swedish universities, foreigners might get special temporary personnummers with a "P", "T", or "F" instead of the first of the four last numbers.
This code fixes the problem, but does not check the validity of the date, or the last number. |
| Matches |
123456-1234 | 123456-P234 | 123456-f234 |
| Non-Matches |
123456-12 | 1234561234 | 123456 |
| Author |
Rating:
Not yet rated.
Petter Terenius
|
| 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:
Not yet rated.
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="http", authority="regexlib.com", path="/REDetails.aspx", query="regexp_id=x" and fragment="Details".
This is a W3C raccomandation (RFC 2396). |
| Matches |
http://regexlib.com/REDetails.aspx?regexp_id=x#Details |
| Non-Matches |
& |
| Author |
Rating:
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
Indian Mobile No
|
| Expression |
^((\+){0,1}91(\s){0,1}(\-){0,1}(\s){0,1}){0,1}9[0-9](\s){0,1}(\-){0,1}(\s){0,1}[1-9]{1}[0-9]{7}$ |
| Description |
This expression is to validate indian mobile nos |
| Matches |
9836193498 +919836193498 9745622222 |
| Non-Matches |
+9197456222222 8745622222 9836193481 |
| Author |
Rating:
Nilarka Prasanna Das
|
Displaying page
of
pages;
Items to