Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^#?([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$ |
Description |
Tests for valid HTML hexadecimal color codes. The # symbol is optional. And it will except either the 3 digit form for the 216 Web safe colors, or the full 6 digit form. I am use it on my site to allow users to customize the site's colors. |
Matches |
#00ccff | #039 | ffffcc |
Non-Matches |
blue | 0x000000 | #ff000 |
Author |
Rating:
Chris Craft
|
Title |
Test
Details
Pattern Title
|
Expression |
\[link="(?<link>((.|\n)*?))"\](?<text>((.|\n)*?))\[\/link\] |
Description |
This can be used in conjunction with the replace method to provide pseudo-code support without having to enable HTML. The replacement string (in ASP.NET, use RegExp.Replace(SourceString, RegularExpressionPattern, ReplacementString) is <a href="${link}">${text}</a>. |
Matches |
[link="http://www.yahoo.com"]Yahoo[/link] |
Non-Matches |
[link]http://www.yahoo.com[/link] | [link=http://www.yahoo.com]Yahoo[/link] |
Author |
Rating:
Not yet rated.
Ryan S
|
Title |
Test
Details
Pattern Title
|
Expression |
^\d{9}[\d|X]$ |
Description |
A very simple ISBN validation expression - it just checks for a 10 digit number where the last digit could also be a capital 'X'. Complete specs for ISBN available here:
http://www.isbn.org/standards/home/isbn/international/html/usm4.htm. An enhancement would be to allow exactly 3 or 0 hyphens or 3 or 0 spaces, since these are also valid formats. |
Matches |
1234123412 | 123412341X |
Non-Matches |
not an isbn |
Author |
Rating:
Not yet rated.
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
<[^>]*\n?.*=("|')?(.*\.jpg)("|')?.*\n?[^<]*> |
Description |
Match any image insert in a tag .
simply replace the .jpg in the pattern whit a variable of content type ex:.swf,.js,.gif and loop the pattern to retrieve all tag whit the contenttype pass trought....
Very useful when you have people uploading html document in your site and you want to retrieve all dependecy. |
Matches |
<td background="../img/img.jpg" > | <img src=img.jpg > | <img src='img.jpg' |
Non-Matches |
= img.jpg | img.jpg |
Author |
Rating:
Not yet rated.
Marc-Antoine Latour
|
Title |
Test
Details
Pattern Title
|
Expression |
<[^>]*name[\s]*=[\s]*"?[^\w_]*"?[^>]*> |
Description |
This RX is used to find get all named tags in an html string. If you find a problem with it, please email [email protected] |
Matches |
<input type = text name = "bob"> | <select name = "fred"> | <form |
Non-Matches |
<input type = submit> | <font face = "arial"> | The drity brown fox stank like |
Author |
Rating:
Not yet rated.
Andrew Freese
|
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 |
<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 |
<!--[\s\S]*?--> |
Description |
Removes pesky comments and commented javascript from HTML |
Matches |
<!-- comments --> | <!-- x = a > b - 3 --> |
Non-Matches |
<COMMENTS>this is a comment</COMMENTS> |
Author |
Rating:
Not yet rated.
Lewis Moten
|
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
|
Title |
Test
Details
Pattern Title
|
Expression |
&lt;/?([a-zA-Z][-A-Za-z\d\.]{0,71})(\s+(\S+)(\s*=\s*([-\w\.]{1,1024}|&quot;[^&quot;]{0,1024}&quot;|'[^']{0,1024}'))?)*\s*&gt; |
Description |
Searches for tags and there atributes according to the HTML 2.0 specification to limit length of tags to 72 characters, and length of attribute values to 1024 characters. |
Matches |
&lt;IMG src='stars.gif' alt=&quot;space&quot; height=1&gt; |
Non-Matches |
this is not a tag |
Author |
Rating:
Not yet rated.
Lewis Moten
|
Title |
Test
Details
Pattern Title
|
Expression |
<[a-zA-Z][^>]*\son\w+=(\w+|'[^']*'|"[^"]*")[^>]*> |
Description |
Find HTML tags that have javascript events attached to them. |
Matches |
<IMG onmouseover="window.close()"> |
Non-Matches |
<IMG src="star.gif"> |
Author |
Rating:
Not yet rated.
Lewis Moten
|
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 |
</?(\w+)(\s*\w*\s*=\s*("[^"]*"|'[^']'|[^>]*))*|/?> |
Description |
Matches HTML of XML tags, with or without attributes (single-, double-, or non-quoted), closing tags, or self-closing singleton tags. |
Matches |
<font color="blue"> | </font> | <br /> |
Non-Matches |
this is a test... |
Author |
Rating:
Not yet rated.
Jean-Philip Losier
|
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 |
<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
Pattern Title
|
Expression |
<[^>]+> |
Description |
This expression finds all opening and closing tags. Good for stripping out tags in an XML or HTML document.
I used it to clean-up HTML documents that had XML mixed in. It found all the tags, then I just deleted the ones that weren't standard. I used it in HOMESITES extended find. |
Matches |
<html> | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | < |
Non-Matches |
Any plain old text | http://www.regexlib.com/Add.aspx | xml> |
Author |
Rating:
X Man
|
Title |
Test
Details
Pattern Title
|
Expression |
^[0-9]{1,}(,[0-9]+){0,}$ |
Description |
It could be use to validate html input form (checkbox, optionbox, selectbox) when you have multiple numeric value under one field name. The validation is that the user have at lease chose one or more! |
Matches |
1111 | 47,26,2,1,1111,12 | 25,1245,2122,23232 |
Non-Matches |
111, | 1a1,111,1212,23 | 11aa,aaa,asas,asa |
Author |
Rating:
Nicholas Rathwell
|
Title |
Test
Details
Pattern Title
|
Expression |
<[iI][mM][gG]([^>]*[^/>]) |
Description |
simple little RegExp to get the IMG tag from HTML |
Matches |
<img src="abc.jpg"> | <img src="abc.jpg"/> | <ImG src="abc.j |
Non-Matches |
none |
Author |
Rating:
Not yet rated.
Asim Goheer
|
Title |
Test
Details
Pattern Title
|
Expression |
\b(((\S+)?)(@|mailto\:|(news|(ht|f)tp(s?))\://)\S+)\b |
Description |
Whilst writing a plain-text to HTML function, I ran into the problem of links that users had written with &lt;a&gt; tags (as opposed to just writing the URL) were linking improperly. This regular expression returns many types of URL, and preceding characters, if any. This allows you to handle each type of match appropriately |
Matches |
|
Non-Matches |
www.deepart.org | deepart.org | 123.123.123.123 |
Author |
Rating:
Not yet rated.
Demo Gorgon
|
Displaying page
of
pages;
Items to