173 regular expressions found in this category!
Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^\{?[a-fA-F\d]{8}-([a-fA-F\d]{4}-){3}[a-fA-F\d]{12}\}?$ |
Description |
Validates a GUID with and without brackets. 8,4,4,4,12 hex characters seperated by dashes. |
Matches |
{e02ff0e4-00ad-090A-c030-0d00a0008ba0} | e02ff0e4-00ad-090A-c030-0d00a0008ba0 |
Non-Matches |
0xe02ff0e400ad090Ac0300d00a0008ba0 |
Author |
Rating:
Not yet rated.
Lewis Moten
|
Title |
Test
Details
Pattern Title
|
Expression |
^[A-Z]{1,2}[1-9][0-9]?[A-Z]? [0-9][A-Z]{2,}|GIR 0AA$ |
Description |
Matches UK postcodes according to the following rules 1. LN NLL eg N1 1AA 2. LLN NLL eg SW4 0QL 3. LNN NLL eg M23 4PJ 4. LLNN NLL eg WS14 0JT 5. LLNL NLL eg SW1N 4TB 6. LNL NLL eg W1C 8LQ. Modifications: 1) Doesn't allow leading zeros in first part (outward) eg BT01 3RT is incorrect; it should be BT1 3RT. 2) Only allows uppercase letters, which is the preference of the UK Post Office. 3) Permits the only postcode to break the rules - GIR 0AA (for the old Girobank, now Alliance & Leicester bank, address) |
Matches |
G1 1AA | GIR 0AA | SW1 1ZZ |
Non-Matches |
BT01 3RT | G111 1AA |
Author |
Rating:
Not yet rated.
Peter Whyte
|
Title |
Test
Details
Pattern Title
|
Expression |
@{2}((\S)+)@{2} |
Description |
This will match results in a template situation. For example:
template reads
Dear @@Name@@,
....
would become
Dear John,
If you dont want to use the @@ change the @ to what ever characters you want.
|
Matches |
@@test@@ | @@name@@ | @@2342@@ |
Non-Matches |
@test@ | @@na me@@ | @@ name@@ |
Author |
Rating:
Not yet rated.
john hamman
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0-1]([\s-./\\])?)?(\(?[2-9]\d{2}\)?|[2-9]\d{3})([\s-./\\])?(\d{3}([\s-./\\])?\d{4}|[a-zA-Z0-9]{7})$ |
Description |
It checks for Valid US Phone numbers.
Accepts ".",Space,\,/,- as delim. |
Matches |
1.222.333.1234 | 1-223-123-1232 | 12223334444 |
Non-Matches |
1.1.123123.123 | 12-1322-112-31 | 11231321131 |
Author |
Rating:
Not yet rated.
Amit Deshpande
|
Title |
Test
Details
Pattern Title
|
Expression |
(\{\\f\d*)\\([^;]+;) |
Description |
This pattern returns the font section from an RTF document. The first parenthetical subexpression captures the font number, the second returns the actual font enumeration. Lame-o, but fun! :-) |
Matches |
{\f0\Some Font names here; | {\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial; | {\f |
Non-Matches |
{f0fs20 some text} |
Author |
Rating:
Not yet rated.
Joel Dooris
|
Title |
Test
Details
Pattern Title
|
Expression |
(("|')[a-z0-9\/\.\?\=\&]*(\.htm|\.asp|\.php|\.jsp)[a-z0-9\/\.\?\=\&]*("|'))|(href=*?[a-z0-9\/\.\?\=\&"']*) |
Description |
Will locate an URL in a webpage.
It'll search in 2 ways - first it will try to locate a href=, and then go to the end of the link. If there is nu href=, it will search for the end of the file instead (.asp, .htm and so on), and then take the data between the "xxxxxx" or 'xxxxxx' |
Matches |
href="produktsida.asp?kategori2=218" | href="NuclearTesting.htm" |
Non-Matches |
U Suck |
Author |
Rating:
Not yet rated.
Henric Rosvall
|
Title |
Test
Details
Pattern Title
|
Expression |
<[^>\s]*\bauthor\b[^>]*> |
Description |
This expression will match the corresponding XML/HTML elements opening and closing tags. Useful to handle documents fragments, without loading an XML DOM.
|
Matches |
<author name="Daniel"> | </sch:author> | <pp:author name="Daniel" |
Non-Matches |
<other> | </authors> | <work>author</work> |
Author |
Rating:
Not yet rated.
Daniel Cazzulino
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0-1]([\s-./\\])?)?(\(?[2-9]\d{2}\)?|[2-9]\d{3})([\s-./\\])?([0-9]{3}([\s-./\\])?[0-9]{4}|[a-zA-Z0-9]{7}|([0-9]{3}[-][a-zA-Z0-9]{4})) |
Description |
USA Alhpanumeric Valid Phone numbers |
Matches |
1.222.333.1234 | 1-223-123-1232 | 1-888-425-DELL |
Non-Matches |
1.1.123123.123 | 12-1322-112-31 | 1-800-CALL-DEL |
Author |
Rating:
Not yet rated.
Amit Deshpande
|
Title |
Test
Details
Pattern Title
|
Expression |
^(/w|/W|[^<>+?$%{}&])+$ |
Description |
simple expression for excluding a given list of characters. simply change the contents of [^] to suite your needs. for example ^(/w|/W|[^<>])+$ would allow everything except the characters < and >. |
Matches |
John Doe Sr. | 100 Elm St., Suite 25 | Valerie's Gift Shop |
Non-Matches |
<h1>Hey</h1> |
Author |
Rating:
Not yet rated.
Glenn Caccia
|
Title |
Test
Details
Pattern Title
|
Expression |
^(ac|AC|al|AL|am|AM|ap|AP|ba|BA|ce|CE|df|DF|es|ES|go|GO|ma|MA|mg|MG|ms|MS|mt|MT|pa|PA|pb|PB|pe|PE|pi|PI|pr|PR|rj|RJ|rn|RN|ro|RO|rr|RR|rs|RS|sc|SC|se|SE|sp|SP|to|TO)$ |
Description |
Valida os todos Estados Brasileiros (UF)
e o distrito Federal
|
Matches |
AC | RJ | SP |
Non-Matches |
XX | AB | HJ |
Author |
Rating:
Not yet rated.
Fernando Cerqueira
|
Title |
Test
Details
Pattern Title
|
Expression |
^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$ |
Description |
Postcode check for Spain |
Matches |
12345 | 10234 | 01234 |
Non-Matches |
00123 |
Author |
Rating:
Not yet rated.
Henk de Vries
|
Title |
Test
Details
Pattern Title
|
Expression |
((?<strElement>(^[A-Z0-9-;=]*:))(?<strValue>(.*))) |
Description |
Usesful for importing vcards. Matches vcard elements and values. |
Matches |
BEGIN: | TEL;WORK;VOICE: | TEL: |
Non-Matches |
begin: | TEL;PREF; |
Author |
Rating:
Not yet rated.
Karsten Grombach
|
Title |
Test
Details
Pattern Title
|
Expression |
^<a\s+href\s*=\s*"http:\/\/([^"]*)"([^>]*)>(.*?(?=<\/a>))<\/a>$ |
Description |
Regexp to find all external links in a HTML string.
Can easily be modified to handle all/other links/protocols (like file/https/ftp).
Uses lookahead assertions and non-greedy modifier to check for the end </a> but still allow html tags inbetween start and end A tag.
Takes into account that there could be linebreaks and other nasty whitespace chars in the middle of the tag.
I am using it to find all external links in embedded HTML code and change 1.the target of the link 2.insert a "Leaving Site" logo to illustrate you are leaving site. |
Matches |
<a href="http://www.mysite.com">my external link</a> | <a href="http:/ |
Non-Matches |
<a href="myinternalpage.html">my internal link</a> |
Author |
Rating:
Not yet rated.
Anders Rask
|
Title |
Test
Details
Pattern Title
|
Expression |
\({1}[0-9]{3}\){1}\-{1}[0-9]{3}\-{1}[0-9]{4} |
Description |
|
Matches |
(111)-111-1111 |
Non-Matches |
11111111111 |
Author |
Rating:
Not yet rated.
s4 s
|
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 |
^[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
|
Displaying page
of
pages;
Items to