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

Please support RegExLib Sponsors

Hosting Spotlight

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 6
Title Test Details To validate the File Type for a FileUploader
Expression
^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.pdf)$
Description
You can use this to check the valid file type you have given to the last in the expression like ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.pdf)$ This will accept .pdf only OR ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+((.pdf)|(.doc))$ This will accept .pdf and .doc OR ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+((.pdf)|(.doc)|(.txt))$ This will accept .pdf , .doc and .txt
Matches
C:\Documents and Settings\chandan.kumar\Desktop\1004.pdf
Non-Matches
C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg
Author Rating: The rating for this expression. Chandan Kumar
Title Test Details DECIMAL CHECK (Max 2 digit after Decimal )
Expression
^\d+(?:\.\d{0,2})?$
Description
This will validatet the Number for Max Tow decimal place after a number.. it will validate like 12, 12.1, 12.23; but it will invalidate 12.326
Matches
100,100.1,100.11
Non-Matches
100.123 , 100.1234
Author Rating: The rating for this expression. Chandan Kumar
Title Test Details Define Maximum length to a TextBox
Expression
^(.|\r|\n){1,10}$
Description
This expression can be use to define the maximum length to a textBox. U can change the maximum character by replacing the last numeric value that is 10 in my example. Just change this number to your desired number like ^(.|\r|\n){1,10}$ : for max 10 character ^(.|\r|\n){1,20}$ : for max 20 character
Matches
ChandanKum
Non-Matches
ChandanKuma
Author Rating: The rating for this expression. Chandan Kumar
Title Test Details MAX length using regex for Textbox with textmode 'Multiline'
Expression
(.|[\r\n]){1,5}
Description
count the space and new line character also .. pass first parameter for minimun and next for maximum character
Matches
r,rr,rrr,rrrr,rrrrr
Non-Matches
rrrrrr
Author Rating: Not yet rated. Chandan Kumar
Title Test Details Email validation
Expression
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
Description
To validate an Email ID
Matches
chandanalways@gmail.com
Non-Matches
chandanalways@gmail..com
Author Rating: The rating for this expression. Chandan Kumar
Title Test Details Text Between Double Quotes
Expression
"([^\\"]|\\.)*"
Description
to get the text betwwen double quotes
Matches
"Ram", "Ram Shyam"
Non-Matches
ram , shyam
Author Rating: The rating for this expression. Chandan Kumar
   Displaying page 1 of 1 pages; Items 1 to 6

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