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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 3
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: The rating for this expression. Chris Craft
Title Test Details Pattern Title
Expression
/\*[\d\D]*?\*/
Description
If you need to extract or remove any /* */ sytle comments from any Java, JavaScript, C, C++, CSS, etc code you have this regular expression can help.
Matches
/* my comment */ | /* my multiline comment */ | /* my nested comment */
Non-Matches
*/ anything here /* | anything between 2 seperate comments | \* *\
Author Rating: The rating for this expression. Chris Craft
Title Test Details Pattern Title
Expression
(AUX|PRN|NUL|COM\d|LPT\d)+\s*$
Description
"Be careful when opening or creating files by using Scripting File System Object. If the filename is based on the user's input, the user might attempt to open a serial port or printer."
Matches
COM1 | AUX | LPT1
Non-Matches
image.jpg | index.html | readme.txt
Author Rating: Not yet rated. Chris Craft
   Displaying page 1 of 1 pages; Items 1 to 3

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