http://blog.outsider.ne.kr/360
ÆÐÅϸÅĪ Á¤±ÔÇ¥Çö½Ä
1. Matching a Username --> .(dot) º¸¿Ï ÇÊ¿ä
/^[a-z0-9_-]{3,16}$/
2. Matching a Password
/^[a-z0-9_-]{6,18}$/
3. Matching a Hex value
/^#?([a-f0-9]{6}|[a-f0-9]{3})$/
MatchµÇ´Â ½ºÆ®¸µ : #a3c113
MatchµÇÁö ¾Ê´Â ¹®ÀÚ¿ : #4d82h4 (h °¡ Æ÷ÇԵǾî ÀÖÀ½)
4. Matching a Slug
/^[a-z0-9-]+$/
mod_rewrite³ª pretty URLÀ» »ç¿ëÇØ º»ÀûÀÌ ÀÖ´Ù¸é ÀÌ Á¤±ÔÇ¥Çö½ÄÀ» »ç¿ëÇÏ°Ô µÉ °ÍÀÔ´Ï´Ù.
½ÃÀÛ ¹®ÀÚ¿ÀÎ ^°¡ óÀ½¿¡ ³ª¿À°í µÚÀÌ¾î ¼Ò¹®ÀÚ, ¼ýÀÚ, ÇÏÀÌÇÂ(-)ÀÌ ÇÑ°³ ¶Ç´Â ÇÑ°³ÀÌ»ó
(+±âÈ£)³ª¿À°í ¸¶Áö¸·À¸·Î ¹®ÀÚ¿ÀÇ ³¡ÀÎ $°¡ ³ª¿É´Ï´Ù.
MatchµÇ´Â ½ºÆ®¸µ : my-title-here
MatchµÇÁö ¾Ê´Â ¹®ÀÚ¿ : my_title_here (¾ð´õ½ºÄÚ¾î( _ ) °¡ Æ÷ÇԵǾî ÀÖÀ½)
5. Matching an Email
/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
6. Matching a URL --> # ¹®ÀÚ º¸¿Ï ÇÊ¿ä
/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
MatchµÇ´Â ½ºÆ®¸µ : http://net.tutsplus.com/about
MatchµÇÁö ¾Ê´Â ¹®ÀÚ¿ : http://google.com/some/file!.html
(´À³¦Ç¥°¡ Æ÷ÇԵǾî ÀÖÀ½)
7. Matching an IP Address
/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
8. Matching an HTML Tag
/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/ |