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

Please support RegExLib Sponsors

Sponsors

Browse Expressions by Category

173 regular expressions found in this category!

Expressions in category: Misc

Change page:   |    Displaying page 1 of 9 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
^[1-9]{1}[0-9]{3} ?[A-Z]{2}$
Description
Postcode check for Netherlands
Matches
1234 AB | 1234AB
Non-Matches
123AB | 1234AAA
Author Rating: The rating for this expression. Henk de Vries
Title Test Details Pattern Title
Expression
^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$
Description
Person's name (first, last, or both) in any letter case. Although not perfect, this expression will filter out many incorrect name formats (especially numerics and invalid special characters).
Matches
T.F. Johnson | John O'Neil | Mary-Kate Johnson
Non-Matches
sam_johnson | Joe--Bob Jones | dfjsd0rd
Author Rating: The rating for this expression. Robert Dugre
Title Test Details Pattern Title
Expression
^[a-zA-Z0-9\s.\-_']+$
Description
Alphanumeric, hyphen apostrophe, comma dash spaces
Matches
dony d'gsa
Non-Matches
^[a-zA-Z0-9\s.\-_']+$
Author Rating: The rating for this expression. Sonal Bordia
Title Test Details Pattern Title
Expression
^[A-Za-z]{6}[0-9LMNPQRSTUV]{2}[A-Za-z]{1}[0-9LMNPQRSTUV]{2}[A-Za-z]{1}[0-9LMNPQRSTUV]{3}[A -Za-z]{1}$
Description
Check italian fiscal code (codice fiscale) with "OMOCODIA" control
Matches
BTTNDR78R06A79QU
Non-Matches
BTTNDR78R06A79AU
Author Rating: The rating for this expression. andrea mele
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: The rating for this expression. Dmitry Kandiner
Title Test Details Pattern Title
Expression
^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).{4,8}$
Description
Password expresion that requires one lower case letter, one upper case letter, one digit, 6-13 length, and no spaces. This is merely an extension of a previously posted expression by Steven Smith (ssmith@aspalliance.com) . The no spaces is new.
Matches
1agdA*$# | 1agdA*$# | 1agdA*$#
Non-Matches
wyrn%@*&$# f | mbndkfh782 | BNfhjdhfjd&*)%#$)
Author Rating: The rating for this expression. Jeremy Samuel
Title Test Details Pattern Title
Expression
\{CHBLOCK\:(.*?\})
Description
Litle regexp for my portal engie. Only cut the {CHBLOCK:'modulename'} item
Matches
{CHBLOCK:sdgs} | {CHBLOCK:sdgs}sdg{CHBLOCK:sdgs}
Non-Matches
{CHBLOCK} | {CHBLOCK:sdgs
Author Rating: The rating for this expression. János Cservenák
Title Test Details Pattern Title
Expression
^((Fred|Wilma)\s+Flintstone|(Barney|Betty)\s+Rubble)$
Description
Match the full names of the four main characters of The Flintstones.
Matches
Fred Flintstone | Barney Rubble | Betty Rubble
Non-Matches
The Great Gazoo | Mr. Slate | Dino
Author Rating: The rating for this expression. Randal L. Schwartz
Title Test Details Pattern Title
Expression
^\d{3}-\d{7}[0-6]{1}$
Description
Airway bill no that allows only the format 999-99999998 and does not allow the last digit to be 7,8,9.
Matches
999-99999995 | 123-47859683 | 156-78965422
Non-Matches
123-47859689 | 9999999999 | 9588-58964
Author Rating: The rating for this expression. DOZENROSES T
Title Test Details Pattern Title
Expression
^([A-Z|a-z]{2}\s{1}\d{2}\s{1}[A-Z|a-z]{1,2}\s{1}\d{1,4})?([A-Z|a-z]{3}\s{1}\d{1,4})?$
Description
It validates Indian Vehicle Registration Number
Matches
mh 12 bj 1780 | mmx 1234
Non-Matches
mmm 123 1234 | mm 12 bj 345 | mm 12345
Author Rating: The rating for this expression. himraj love
Title Test Details Pattern Title
Expression
<img([^>]*[^/])>
Description
Use this along with this replacement string &lt;img\1 /&gt; to convert image tags to XHTML compliant image tags.
Matches
<img src="bob">
Non-Matches
<img src="bob" />
Author Rating: The rating for this expression. Murray Roke
Title Test Details Pattern Title
Expression
(\[[Ii][Mm][Gg]\])(\S+?)(\[\/[Ii][Mm][Gg]\])
Description
easy when you want to allow your users to post images, but in a controlled way. I used it like this (in php): $text = preg_replace(&quot;/(\[IMG\])(\S+?)(\[\/IMG\])/is&quot;, &quot;&lt;a href=\&quot;\\2\&quot; target=\&quot;_blank\&quot;&gt;&lt;IMG SRC=\&quot;\\2\&quot; align=\&quot;center\&quot; height=\&quot;100\&quot; border=\&quot;0\&quot;&gt;&lt;/a&gt;&quot;,$text); so whenever they use [img]http://www.foo.com/bleh.jpg[/img] it will be converted to &lt;a href=&quot;http://www.foo.com/bleh.jpg&quot; target=&quot;_blank&quot;&gt;&lt;IMG SRC=&quot;http://www.foo.com/bleh.jpg&quot; align=&quot;center&quot; height=&quot;100&quot; border=&quot;0&quot;&gt;&lt;/a&gt; so you get a 100 pixels high picture, and when they click on it it opens in a new window... (to prevent users from posting huge pictures and stuff)
Matches
[IMG]http://bleh.jpg[/IMG] | [ImG]bleh[/imG] | [img]ftp://login:pass@bleh.gif[/img]
Non-Matches
&lt;img src=&quot;bleh.jpg&quot;&gt;
Author Rating: The rating for this expression. marnik vander elst
Title Test Details Pattern Title
Expression
^([0-7])*$
Description
Expression validating a octal string of any length.
Matches
1357 | 445005 | 101
Non-Matches
900508 | 7FFF | 599D
Author Rating: The rating for this expression. Cliff Wagner
Title Test Details Pattern Title
Expression
^(1|2|3)((\d{2}((0[13578]|1[02])(0[1-9]|[12]\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\d|30)|02(0[1-9]|1\d|2[0-8])))|([02468][048]|[13579][26])0229)(\d{5})$
Description
This pattern matches a Valid Civil ID Number in Kuwait.
Matches
175123112345 | 279020412345
Non-Matches
479020412345 | 275043112345
Author Rating: The rating for this expression. Ronnel Santiago
Title Test Details Pattern Title
Expression
\b(([01]?\d?\d|2[0-4]\d|25[0-5])\.){3}([01]?\d?\d|2[0-4]\d|25[0-5])\b
Description
Most Concise RegExp for matching Decimal IPs. If nothing else, it'll make your code easier to read. (And I know that \d?\d is \d{1,2} but that's 2 extra characters.) --Update: darkone noticed 8 characters could be shaved down. I've edited it to reflect this. Thanks, darkone!
Matches
217.6.9.89 | 0.0.0.0 | 255.255.255.255
Non-Matches
256.0.0.0 | 0978.3.3.3 | 65.4t.54.3
Author Rating: The rating for this expression. Sean Schricker
Title Test Details Pattern Title
Expression
^([0-1])*$
Description
Expression validating a Binary string of any length
Matches
10101000 | 01010000 | 100000001
Non-Matches
01000200 | 00021000 | e10000000
Author Rating: The rating for this expression. Cliff Wagner
Title Test Details Pattern Title
Expression
^\D?(\d{3})\D?\D?(\d{3})\D?(\d{4})$
Description
This RegEx requires a US phone number WITH area code. It is written to all users to enter whatever delimiters they want or no delimiters at all (i.e. 111-222-3333, or 111.222.3333, or (111) 222-3333, or 1112223333, etc...).
Matches
(111) 222-3333 | 1112223333 | 111-222-3333
Non-Matches
11122223333 | 11112223333 | 11122233333
Author Rating: The rating for this expression. Laurence O'Donnell
Title Test Details Pattern Title
Expression
^(eth[0-9]$)|(^eth[0-9]:[1-9]$)
Description
regex to validate unix device names (linux). useful for scripts using ifconfig or stuff
Matches
eth0 | eth0:4 | eth4:9
Non-Matches
eth0: | eth0:0 | eth0:1d
Author Rating: The rating for this expression. Joey Brunner
Title Test Details Pattern Title
Expression
\u221E
Description
Matches infinity symbol. Pretty simple, yet I dont think existed on RegExLib before.
Matches
8
Non-Matches
anything else
Author Rating: The rating for this expression. Roman Lukyanenko
Title Test Details Pattern Title
Expression
[:]{1}[-~+o]?[)&gt;]+
Description
This ist the Expression for a happy smiley. It should find all the usual writings of the emotion icon :)
Matches
:))))) | :+&gt; | :o)
Non-Matches
;o) | :-(
Author Rating: The rating for this expression. Ullrich Clemenz Canaan
Change page:   |    Displaying page 1 of 9 pages; Items 1 to 20

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