173 regular expressions found in this category!
Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^[0-9A-Za-z_ ]+(.[jJ][pP][gG]|.[gG][iI][fF])$ |
Description |
Matches HTML image leaf filenames. |
Matches |
good.gif | go d.GIf | goo_d.jPg |
Non-Matches |
junk | bad.bad.gif | slash\gif. |
Author |
Rating:
Not yet rated.
Geoffrey Swenson
|
Title |
Test
Details
Pattern Title
|
Expression |
^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$ |
Description |
Regular expression to match valid UK postcodes.
In the UK postal system not all letters are used in all positions (the same with vehicle registration plates) and there are various rules to govern this. This regex takes into account those rules.
Details of the rules:
First half of postcode
Valid formats
[A-Z][A-Z][0-9][A-Z]
[A-Z][A-Z][0-9][0-9]
[A-Z][0-9][0-9]
[A-Z][A-Z][0-9]
[A-Z][A-Z][A-Z]
[A-Z][0-9][A-Z]
[A-Z][0-9]
Exceptions
Position - First.
Contraint - QVX not used
Position - Second.
Contraint - IJZ not used except in GIR 0AA
Position - Third.
Constraint - AEHMNPRTVXY only used
Position - Forth.
Contraint - ABEHMNPRVWXY
Second half of postcode
Valid formats
[0-9][A-Z][A-Z]
Exceptions
Position - Second and Third.
Contraint - CIKMOV not used
|
Matches |
DN3 6GB | SW42 4RG | GIR 0AA |
Non-Matches |
SEW4 5TY | AA2C 4FG | AA2 4CV |
Author |
Rating:
Not yet rated.
Stuart Wade
|
Title |
Test
Details
Pattern Title
|
Expression |
\w?<\s?\/?[^\s>]+(\s+[^"'=]+(=("[^"]*")|('[^\']*')|([^\s"'>]*))?)*\s*\/?> |
Description |
Matches tags |
Matches |
<world www="hello" /> |
Non-Matches |
<>>>world www="hello" /> |
Author |
Rating:
Not yet rated.
Darren Neimke
|
Title |
Test
Details
Pattern Title
|
Expression |
^[^']*$ |
Description |
This one matches all strings that do not contain the single quotation mark ('). |
Matches |
asljas | %/&89uhuhadjkh | "hi there!" |
Non-Matches |
'hi there!' | It's 9 o'clock | ''''' |
Author |
Rating:
Not yet rated.
Peter Friese
|
Title |
Test
Details
Pattern Title
|
Expression |
^([a-zA-Z0-9][-a-zA-Z0-9]*[a-zA-Z0-9]\.)+([a-zA-Z0-9]{3,5})$ |
Description |
Host/Domain name validation for perl.
Should be combined with a check for
length <= 63 characters and that $2
is in a list of top-level domains. |
Matches |
freshmeat.net | 123.com | TempLate-toolkKt.orG |
Non-Matches |
-dog.com | ?boy.net | this.domain |
Author |
Rating:
Not yet rated.
Nathan Pitts
|
Title |
Test
Details
Pattern Title
|
Expression |
<[aA][ ]{0,}([a-zA-Z0-9"'_,.:;!?@$&()%=/ ]|[-]|[ \f]){0,}>((<(([a-zA-Z0-9"'_,.:;!?@$&()%=/ ]|[-]|[ \f]){0,})>([a-zA-Z0-9"'_,.:;!?@$&()%=/ ]|[-]|[ \f]){0,})|(([a-zA-Z0-9"'_,.:;!?@$&()%=/ ]|[-]|[ \f]){0,})){0,} |
Description |
I wrote this sweet little (well, not so little really) reg to extract links from an HTML source.... it is very robust, give it a try.
The only limitation I have discovered is that it can't match invalid HTML... |
Matches |
<a href='javascript:functionA();'><i>this text is italicized</i></a> |
Non-Matches |
<A href='#'><P</A></P> |
Author |
Rating:
Not yet rated.
Brian Webb
|
Title |
Test
Details
Pattern Title
|
Expression |
^\d{3,3}\.\d{0,2}$|^E\d{3,3}\.\d{0,2}$ |
Description |
ICD9 code pattern |
Matches |
E123. | 123.0 | 045.23 |
Non-Matches |
b123. | 3456.0 |
Author |
Rating:
Not yet rated.
Zeljko Stanfel
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\+[1-9][0-9]*(\([0-9]*\)|-[0-9]*-))?[0]?[1-9][0-9\- ]*$ |
Description |
International phone number check - optional country code followed by area code surrounded with '-' or '(' and ')', or just an area code optionally starting with 0, followed by phone numder. The number itself may contain spaces and '-' |
Matches |
+123(45)678-910 | +123-045-67 89 10 | 01-234-56-78 |
Non-Matches |
123(45)678 91011 | (12)345-678 | +0(12)345-6789 |
Author |
Rating:
Not yet rated.
Dmitry Kandiner
|
Title |
Test
Details
Pattern Title
|
Expression |
[^A-Za-z0-9_@\.]|@{2,}|\.{5,} |
Description |
Used as a username validation script requires:
1. Allows All Alphanumeric characters & underscore
2. Allows One "@" character
3. Allows Five "." periods
4. Rejects spaces
|
Matches |
user name | user#name | ..... |
Non-Matches |
|
Author |
Rating:
Not yet rated.
Theo Tillotson
|
Title |
Test
Details
Pattern Title
|
Expression |
(([01][\.\- +]\(\d{3}\)[\.\- +]?)|([01][\.\- +]\d{3}[\.\- +])|(\(\d{3}\) ?)|(\d{3}[- \.]))?\d{3}[- \.]\d{4} |
Description |
167 different US telephone patterns. Options includes a)0 or 1 dial, b)area code, c).+-()space between number dial-area code-number. |
Matches |
1 (999) 999 9999 | 999 999 9999 | 999 9999 |
Non-Matches |
19999999999 | 9999999999 | 9999999 |
Author |
Rating:
Not yet rated.
Dennis Zweigle
|
Title |
Test
Details
Pattern Title
|
Expression |
{.*} |
Description |
Simple, but it gave me trouble in the c#... |
Matches |
{User}, thank you for submitting a new project request! |
Non-Matches |
Thank you for submitting a new project request! |
Author |
Rating:
Not yet rated.
scott cole
|
Title |
Test
Details
Pattern Title
|
Expression |
^\(?[\d]{3}\)?[\s-]?[\d]{3}[\s-]?[\d]{4}$ |
Description |
This regular expression matches 10 digit US Phone numbers in different formats. Some examples are
1)area code in paranthesis.
2)space between different parts of the phone number.
3)no space between different parts of the number.
4)dashes between parts.
|
Matches |
(573)8841878 | 573-884-1234 | 573 234 1256 |
Non-Matches |
(573)(673)2345 | 573-12-2345 |
Author |
Rating:
Not yet rated.
kode kode
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$ |
Description |
This will grep for a valid MAC address , with colons seperating octets. It will ignore strings too short or long, or with invalid characters. It will accept mixed case hexadecimal. Use extended grep. |
Matches |
01:23:45:67:89:ab | 01:23:45:67:89:AB | fE:dC:bA:98:76:54 |
Non-Matches |
01:23:45:67:89:ab:cd | 01:23:45:67:89:Az | 01:23:45:56: |
Author |
Rating:
Not yet rated.
Ted Rudyk
|
Displaying page
of
pages;
Items to