173 regular expressions found in this category!
Displaying page
of
pages;
Items to
| Title |
Test
Details
Pattern Title
|
| Expression |
(?:\d|I{1,3})?\s?\w{2,}\.?\s*\d{1,}\:\d{1,}-?,?\d{0,2}(?:,\d{0,2}){0,2} |
| Description |
This RE validates standard Bible verse notation. |
| Matches |
Genesis 3:3-4,6 | II Sam 2:11,2 | 2 Tim 3:16 |
| Non-Matches |
Genesis chap 3, verse 3 | 2nd Samuel 2 |
| Author |
Rating:
Scott Kahler
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^([a-z0-9]{32})$ |
| Description |
Matches a md5 hash, simple yet powerful |
| Matches |
790d2cf6ada1937726c17f1ef41ab125 |
| Non-Matches |
790D2CF6ADA1937726C17F1EF41AB125 | 790d2cf6ada1937726c17f1ef41ab125f6k |
| Author |
Rating:
Thijs Wijnmaalen
|
| 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:
andrea mele
|
| Title |
Test
Details
Pattern Title
|
| Expression |
<img([^>]*[^/])> |
| Description |
Use this along with this replacement string <img\1 /> to convert image tags to XHTML compliant image tags.
|
| Matches |
<img src="bob"> |
| Non-Matches |
<img src="bob" /> |
| Author |
Rating:
Murray Roke
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^([0-9]{2})?(\([0-9]{2})\)([0-9]{3}|[0-9]{4})-[0-9]{4}$ |
| Description |
A simple expression to brazilian phone number code, with international code.
Simple DDI without "+" 99 plus simple DDD (99) plus simple local phone number 3 or 4 digits plus "-" plus 4 digits. |
| Matches |
55(21)123-4567 | (11)1234-5678 | 55(71)4562-2234 |
| Non-Matches |
3434-3432 | 4(23)232-3232 | 55(2)232-232 |
| Author |
Rating:
Rafael Miranda
|
| Title |
Test
Details
Pattern Title
|
| Expression |
\u00AE |
| Description |
Matches the registered trademark (®). Pretty simple, yet I dont think existed on RegExLib before. |
| Matches |
® |
| Non-Matches |
anything else |
| Author |
Rating:
Roman Lukyanenko
|
| 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:
Sean Schricker
|
| Title |
Test
Details
Pattern Title
|
| Expression |
\d{4}-?\d{4}-?\d{4}-?\d{4} |
| Description |
Major credit card validator. Only checks that the format is 16 digits (optionally separated by hyphens), not the value of any of the digits. |
| Matches |
1234-1234-1234-1234 | 1234123412341234 |
| Non-Matches |
1234123412345 |
| 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 |
^(?=.*\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 |
[:]{1}[-~+o]?[)>]+ |
| Description |
This ist the Expression for a happy smiley. It should find all the usual writings of the emotion icon :) |
| Matches |
:))))) | :+> | :o) |
| Non-Matches |
;o) | :-( |
| Author |
Rating:
Ullrich Clemenz Canaan
|
| 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 |
^(([\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 |
^(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 |
(\[[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 |
^([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:
himraj love
|
| 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 |
(\/\/-->\s*)?<\/?SCRIPT([^>]*)>(\s*<!--\s)? |
| Description |
Can be used to remove
&amp;lt;SCRIPT language=&amp;quot;JavaScript&amp;quot;&amp;gt;
&amp;lt;!--
//--&amp;gt;
&amp;lt;/SCRIPT&amp;gt;
from embeded javascript
Should be used as case insensitive |
| Matches |
<SCRIPT language="JavaScript"> <!-- //--> </SCRIPT> | <SCRIPT l |
| Non-Matches |
<!-- //--> |
| Author |
Rating:
Mike t
|
| Title |
Test
Details
Pattern Title
|
| Expression |
\u00A3 |
| Description |
Matches the British Pound symbol. Pretty simple, yet I dont think existed on RegExLib before. |
| Matches |
£ |
| Non-Matches |
anything else |
| Author |
Rating:
Roman Lukyanenko
|
Displaying page
of
pages;
Items to