Archive for January, 2011

A regex that matches all credit cards

Regular Expression For Credit Card Numbers

Regular Expression For Credit Cards

This is a regular expression that validates all credit card numbers including VISA, MASTER, AMEX and DISCOVERY! ^((4\d{3})|(5[1-5]\d{2})|(6011)|(34\d{1})|(37\d{1}))-?\d{4}-?\d{4}-?\d{4}|3[4,7][\d\s-]{15}$

<asp:RegularExpressionValidator ID="CreditCardValidator" runat="server" 
   ControlToValidate="CreditCardNumber" Display="Static" 
   ErrorMessage="Please enter valid card number" 
   ValidationExpression="^((4\d{3})|(5[1-5]\d{2})|(6011)|(34\d{1})|(37\d{1}))-?\d{4}-?\d{4}-?\d{4}|3[4,7][\d\s-]{15}$"  
  ValidationGroup="CustomSignup" Text="*" />

Conversion from Currency into English Words

Currency into Words

Currency into Words

I often need to convert the amounts into words when i create reports, checks and stuff. I found that the following recursive functions do the job perfectly. Most of the examples you can find out there are too long and confusing. This one seems to be shortest and str8 forward. Please check it out:

Read the rest of this entry »

Happy New Year 2011

Happy New Year 2011

Happy New Year 2011

 

 

may the New Year begin on a prosperous note! To all ASP.NET developers and their families! Cheers!!!