Displaying page
of
pages;
Items to
Title |
Test
Details
Regular Expression to check dollar amount with maximum of 20 numbers
|
Expression |
^(\$?)((\d{1,20})|(\d{1,2}((,?\d{3}){0,6}))|(\d{3}((,?\d{3}){0,5})))$
|
Description |
This expression will allow whole dollar amounts (along with $ and ,) which are 20 digit wide. So the maximum amount will be $99,999,999,999,999,999,999. Note: This regular expression allows skipped commas, but will not allow multiple or commas at the wrong location. This can be used for all languages that have comma before the 3rd, 6th, 9th... digit.
|
Matches |
$99,999,999,999,999,999,999 | $56,987 | 56,123456,456
|
Non-Matches |
$77,8,888 | asadf | 67.98
|
Author |
Rating:
Not yet rated.
Moiz Tankiwala
|
Title |
Test
Details
Date validation with leap year 2010 to 2099
|
Expression |
^((((((0?[1-9])|([1-2][0-9])|(3[0-1]))-(([jJ][aA][nN])|([mM][aA][rR])|([mM][aA][yY])|([jJ][uU][lL])|([aA][uU][gG])|([oO][cC][tT])|([dD][eE][cC])))|(((0?[1-9])|([1-2][0-9])|(30))-(([aA][pP][rR])|([jJ][uU][nN])|([sS][eE][pP])|([nN][oO][vV])))|(((0?[1-9])|(1[0-9])|(2[0-8]))-([fF][eE][bB])))-(20(([13579][01345789])|([2468][1235679]))))|(((((0?[1-9])|([1-2][0-9])|(3[0-1]))-(([jJ][aA][nN])|([mM][aA][rR])|([mM][aA][yY])|([jJ][uU][lL])|([aA][uU][gG])|([oO][cC][tT])|([dD][eE][cC])))|(((0?[1-9])|([1-2][0-9])|(30))-(([aA][pP][rR])|([jJ][uU][nN])|([sS][eE][pP])|([nN][oO][vV])))|(((0?[1-9])|(1[0-9])|(2[0-9]))-([fF][eE][bB])))-(20(([13579][26])|([2468][048])))))$
|
Description |
This expression can validate dates in the range of years 2010-2099 with accounting for leap year. Format of date dd-mmm-yyyy.
With a bit of tweaking, the year range can be expanded. Didn't do it myself as requirement was to validate future dates.
|
Matches |
29-fEb-2012, 1-JaN-2013, 31-Dec-2099
|
Non-Matches |
29-feb-2013, 35-nov-2078, 25-dec-2100
|
Author |
Rating:
Not yet rated.
Moiz Tankiwala
|
Displaying page
of
pages;
Items to