Posted By

krisdb on 02/15/08


Tagged

c-sharp


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

wbowers
ad5qa
umang_nine
vali29
fyreflyX
jalalx


Regex's


 / Published in: C#
 

  1. Floating point number: [-+]?[0-9]*\.?[0-9]+
  2.  
  3. Email: \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
  4.  
  5. Zipcode: ^(?!0{5})(\d{5})(?!-?0{4})(-?\d{4})?$
  6.  
  7. 4-digit number: ^\d{4}$
  8.  
  9. Date: \d{1,2}:\d{2} [aApP]M)|(\d{1,2}/\d{1,2}/\d{4}
  10.  
  11. Time: ^((([0]?[1-9]|1[0-2])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?( )?(AM|am|aM|Am|PM|pm|pM|Pm))|(([0]?[0-9]|1[0-9]|2[0-3])(:|\.)[0-5][0-9]((:|\.)[0-5][0-9])?))$
  12.  
  13. Number of characters: ^[\s\S]{0,2000}$
  14.  
  15. Strip punctionation: \p{P}

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: krisdb on February 19, 2008
Posted By: krisdb on February 28, 2008

You need to login to post a comment.