173 regular expressions found in this category!
Displaying page
of
pages;
Items to
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:
Cliff Wagner
|
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:
János Cservenák
|
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:
Joey Brunner
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$ |
Description |
Password matching expression. Password must be at least 4 characters, no more than 8 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit. |
Matches |
asD1 | asDF1234 | ASPgo123 |
Non-Matches |
asdf | 1234 | ASDF12345 |
Author |
Rating:
Steven Smith
|
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:
Randal L. Schwartz
|
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("/(\[IMG\])(\S+?)(\[\/IMG\])/is", "<a href=\"\\2\" target=\"_blank\"><IMG SRC=\"\\2\" align=\"center\" height=\"100\" border=\"0\"></a>",$text);
so whenever they use
[img]http://www.foo.com/bleh.jpg[/img]
it will be converted to
<a href="http://www.foo.com/bleh.jpg" target="_blank"><IMG SRC="http://www.foo.com/bleh.jpg" align="center" height="100" border="0"></a>
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: [email protected][/img] |
Non-Matches |
<img src="bleh.jpg"> |
Author |
Rating:
marnik vander elst
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([\w][\w\-\.]*)\.)?([\w][\w\-]+)(\.([\w][\w\.]*))?$ |
Description |
Is used to evaluating domain names, none of the extras such as paths or protocols. |
Matches |
zigamorph.com | www.zigamorph.com | localhost |
Non-Matches |
http://www.zigamorph.com | ftp://zigamorph.com | localhost/default.aspx |
Author |
Rating:
Nicholas Berardi
|
Title |
Test
Details
Pattern Title
|
Expression |
(\s*\(?0\d{4}\)?\s*\d{6}\s*)|(\s*\(?0\d{3}\)?\s*\d{3}\s*\d{4}\s*) |
Description |
UK Phone Number Allows leading and trailing spaces and optional spaces after the dialing code.
Initially the expression I posted was
\s*0\d{4}\s*\d{6}\s*|\s*0\d{3}\s*\d{7}\s*
But this didn't include optional brackets e.g. (01603) 123123 or phone numbers in a London format e.g. 0208 123 1234 |
Matches |
01603 123123 | 0207 1234567 | (0208) 123 1234 |
Non-Matches |
123 123132 |
Author |
Rating:
Joe Gass
|
Title |
Test
Details
Pattern Title
|
Expression |
<script[^>]*>[\w|\t|\r|\W]*</script> |
Description |
this pattern can find all lines of script in HTML code from open to close tag range |
Matches |
<script language=javascript>document.write("one");</script> |
Non-Matches |
-- |
Author |
Rating:
Bassel Issa
|
Title |
Test
Details
US ZIP (5 or 5+4)
|
Expression |
^\d{5}$|^\d{5}-\d{4}$ |
Description |
This regular expression will match either a 5 digit ZIP code or a ZIP+4 code formatted as 5 digits, a hyphen, and another 4 digits. Other than that, this is just a really really long description of a regular expression that I'm using to test how my front page will look in the case where very long expression descriptions are used. |
Matches |
55555-5555 | 34564-3342 | 90210 |
Non-Matches |
434454444 | 645-32-2345 | abc |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^07([\d]{3})[(\D\s)]?[\d]{3}[(\D\s)]?[\d]{3}$ |
Description |
UK Mobile phone regular expression.
I usually run this against a telephone field to split out landlines and mobile numbers. |
Matches |
07976444333 | 07956-514333 | 07988-321-213 |
Non-Matches |
+44 07976444333 | 08956-444-444 |
Author |
Rating:
Daren Salter
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?(^00000(|-0000))|(\d{5}(|-\d{4})))$ |
Description |
US zip code expression that disallows 00000 or 00000-0000 for either ZIP or ZIP+4. Great for web site validation. |
Matches |
12345 | 12345-6789 |
Non-Matches |
00000 | 00000-0000 | a4650-465s |
Author |
Rating:
Paul Duncan
|
Title |
Test
Details
Pattern Title
|
Expression |
^([ \u00c0-\u01ffa-zA-Z'])+$ |
Description |
Expression to match names and dis-allow any attempts to send evil characters. In particular, it tries to allow
non-english names by allowing unicode characters. |
Matches |
Jon Doe | Jørn | Mc'Neelan |
Non-Matches |
Henry); hacking attempt |
Author |
Rating:
tom ferguson
|
Title |
Test
Details
Pattern Title
|
Expression |
\(([0-9]{2}|0{1}((x|[0-9]){2}[0-9]{2}))\)\s*[0-9]{3,4}[- ]*[0-9]{4} |
Description |
Match diferent styles for brazilian Phone number code.
Only DDD (12), complete DDD (012), complete DDD + Telephony Company (0xx12) plus 3 or 4 digits (city code) plus 4 digits (phone number). |
Matches |
(12) 123 1234 | (01512) 123 1234 | (0xx12) 1234 1234 |
Non-Matches |
12 123 1234 | (012) 123/1234 | (012) 123 12345 |
Author |
Rating:
Samuel Mota
|
Title |
Test
Details
ZIP+4 - XXXXX-XXXX
|
Expression |
^\d{5}-\d{4}$ |
Description |
Numeric and hyphen 5+4 ZIP code match for ZIP+4. |
Matches |
22222-3333 | 34545-2367 | 56334-2343 |
Non-Matches |
123456789 | A3B 4C5 | 55335 |
Author |
Rating:
Steven Smith
|
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 ( [email protected]) . The no spaces is new. |
Matches |
1agdA*$# | 1agdA*$# | 1agdA*$# |
Non-Matches |
wyrn%@*&$# f | mbndkfh782 | BNfhjdhfjd&*)%#$) |
Author |
Rating:
Jeremy Samuel
|
Title |
Test
Details
Pattern Title
|
Expression |
</?(\w+)(\s+\w+=(\w+|"[^"]*"|'[^']*'))*> |
Description |
Finds any HTML tag and sub-matches properties weather it has an apposterphee, quote, or no quote/apposterphee
|
Matches |
<TD> | <TD bgColor="FFFFFF"> | </TD> |
Non-Matches |
No Tag Here ... |
Author |
Rating:
Lewis Moten
|
Displaying page
of
pages;
Items to