본문 바로가기
Programming/Web

[HTML5] 옵션 patten

by Chan_찬 2012. 8. 1.
728x90
반응형




DescriptionPattern  
Credit Card Number [0-9]{13,16}    
Diners Club Card ^([30|36|38]{2})([0-9]{12})$    
ICQ UIN ([1-9])+(?:-?\d){4,}    
Alpha-Numeric ^[a-zA-Z0-9]+$    
Domain like "abc.de" ^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$    
IPv4 Address ((^|\.)((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]?\d))){4}$    
IPv6 Address ((^|:)([0-9a-fA-F]{0,4})){1,8}$    
Username with 2-20 chars (format: string+string|number) ^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$    
Password (UpperCase, LowerCase and Number) ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).*$    
Password (UpperCase, LowerCase, Number/SpecialChar and min 8 Chars) (?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$    
American Postal Code (format is nnnnn or nnnnn-nnnn) (\d{5}([\-]\d{4})?)    
Canadian Postal Code (Format: A0A 0A0) ^([A-Za-z][0-9][A-Za-z] [0-9][A-Za-z][0-9])$    
Australia Postal Code (Format: nnnn) ^[0-9]{4}$    
Austrian Postal Code (Format: nnnn) ^[0-9]{4}$    
Hungarian Postal Code (Format: nnnn) ^[0-9]{4}$    
German Postal Code (Format: nnnnn) ^[0-9]{5}$    
Swedish Postal Code (Format: nnnnn) ^[0-9]{5}$    
Japanese Postal Code (Format: nnn-nnnn) ^\d{3}-\d{4}$    
Spanish Postal Code (Format: 01xxx to 50xxx) ((0[1-9]|5[0-2])|[1-4][0-9])[0-9]{3}    
Dutch Postal Code (Format: 1234 aa) ^[1-9][0-9]{3}\s?[a-zA-Z]{2}$    
Date (Format: YYYY-MM-DD) [0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])    
Full Date Validation (YYYY-MM-DD) (?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))    
Date (Format: MM/DD/YYYY) (0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d    
Full date validation (MM/DD/YYYY) (?:(?:0[1-9]|1[0-2])[\/\\-. ]?(?:0[1-9]|[12][0-9])|(?:(?:0[13-9]|1[0-2])[\/\\-. ]?30)|(?:(?:0[13578]|1[02])[\/\\-. ]?31))[\/\\-. ]?(?:19|20)[0-9]{2}    
Latitude or Longitude -?\d{1,3}\.\d+    
Price (Format: 1.00) \d+(\.\d{2})?    
Price (Format: 1,00) \d+(,\d{2})?    
Phone Number (Format: +99(99)9999-9999) [\+]\d{2}[\(]\d{2}[\)]\d{4}[\-]\d{4}    
Integers with or without decimals (Format: 9 or 9.9) \-?\d+(\.\d{0,})?    
UUID ^[0-9A-Fa-f]{8}\-[0-9A-Fa-f]{4}\-[0-9A-Fa-f]{4}\-[0-9A-Fa-f]{4}\-[0-9A-Fa-f]{12}$


728x90
728x90
BIG
Buy me a coffeeBuy me a coffee

댓글