ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î

ÀÎÅÍ³Ý ÁÖ¼Ò À¯È¿¼º °Ë»ç (regular expression for url)
7³â Àü
ÀÎÅÍ³Ý ÁÖ¼Ò À¯È¿¼º °Ë»ç´Â ¹¹°¡ ¿Ïº®ÇÑ °É±î..
¼­Ä¡ Áß¿¡ °¡Àå ¿ÂÀüÇÑ °Í.
https://gist.github.com/dperini/729294


public static boolean isVaildUrl(String url) {
    String reg =
            "^" +
            // protocol identifier
            "(?:(?:https?|ftp)://)" +
            // user:pass authentication
            "(?:\\S+(?::\\S*)?@)?" +
            "(?:" +
              // IP address exclusion
              // private & local networks
              "(?!(?:10|127)(?:\\.\\d{1,3}){3})" +
              "(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" +
              "(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})" +
              // IP address dotted notation octets
              // excludes loopback network 0.0.0.0
              // excludes reserved space >= 224.0.0.0
              // excludes network & broacast addresses
              // (first & last IP address of each class)
              "(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" +
              "(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" +
              "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" +
            "|" +
              // host name
              "(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)" +
              // domain name
              "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" +
              // TLD identifier
              "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))" +
            ")" +
            // port number
            "(?::\\d{2,5})?" +
            // resource path
            "(?:/?\\S*)?" +
          "$";
    
    return url.matches(reg);
}


ÀÌ ÇÔ¼öµµ ¹®Á¦°¡ Çϳª Àִµ¥..  http://localhost:8080 ¿¡ ´ëÇؼ­´Â false¸¦ ³»¹ñ´Â´Ù.

½ÇÁ¦ µµ¸ÞÀÎ ÁÖ¼Ò¿¡ ¸Â´Â °Ë»ç¶ó°í º¸¸é µÉ µí.
ÃßõÃßõ : 233 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
1,256
[ANDROID & PHP] °£´ÜÇÑ ·Î±×ÀÎ ÀÎÁõ
1,255
ÇöÀç½Ã°£ °¡Á®¿À±â
1,254
ÇÑ ¸Þ¼Òµå·Î Spinner ¿©·¯°³ »ç¿ëÇϱâ
1,253
startActivityForResult °ª ÁÖ°í¹Þ±â
1,252
Ä¿½ºÅÒ ´ÙÀ̾ó·Î±× ¸¸µé±â
1,251
Android ÀÇ Storage Path ¹× ÄÚµå ±¸Çö ±â¼ú
1,250
¾Èµå·ÎÀ̵忡¼­ ¶ç¿ï¼ö ÀÖ´Â ¿©·¯°¡Áö ´ÙÀ̾ó·Î±×
1,249
3°¡Áö ¸Þ¼Òµå·Î ³¡³»´Â ¾Èµå·ÎÀÌµå ¸¶½Ã¸á·Î ±ÇÇÑ È¹µæ
1,248
ACTIVITY¿¡¼­ Ȩ ¹öÆ° CATCH ÇÏ´Â ÇÔ¼ö
1,247
ÇöÀç ½ÇÇàÁßÀÎ ACTIVITY¸¦ ¾Ë¾Æ¿À´Â ÇÔ¼ö
1,246
°­Á¦·Î ȨŰ ´­¸°°Í ó·³
1,245
¾Èµå·ÎÀ̵å ÀÎÅÙÆ® / intent
1,244
¸ð¹ÙÀÏ ½º¸¶Æ®Æù Ư¼ö¹®ÀÚ ¸ðÀ½
1,243
Android/iOS UserAgent ±¸ºÐ ¹× ¸ð¹ÙÀÏÀ¥ÆäÀÌÁö¿¡¼­ ¾Û ¼³Ä¡ ¿©ºÎ È®ÀÎ
1,242
Android À¥ ºê¶ó¿ìÀú ¸µÅ©·Î ¾Û ½ÇÇà ¹æ¹ý
1,241
WebView File Upload
1,240
Get RealPath from Uri
1,239
android.net.conn.CONNECTIVITY_CHANGE
1,238
Glide ¿¡¼­ Gif ·Îµå°¡ ³Ê¹« ´À·Á¿ä.
1,237
ImageView¸¦ Width ±æÀÌ¿¡ ¸ÂÃç Height Á¶Àý
1,236
³»Àå ½ºÇÇÄ¿·Î ¿¬°á Çϱâ
1,235
Media Player¸¦ ÀÌ¿ëÇÑ À½¾Ç Àç»ý ¾îÇø®ÄÉÀÌ¼Ç ¸¸µé¾îº¸±â
1,234
DataBinding - findViewById ÀÌÁ¦ ¾È³ç~
1,233
[DataBinding] String Format Àû¿ëÇϱâ
1,232
[DataBinding] ImageView src¿¡ ¿¬µ¿ Çϱâ (ÇÔ¼ö ¿¬°á)
1,231
Scheme ¼³Á¤ ½Ã, ¾ÛÀÌ ¾Èº¸ÀÌ´Â Çö»ó
1,230
WebView¿¡¼­ Javascript Alert âÀÌ º¸ÀÌÁö ¾ÊÀ» ¶§
1,229
À¥ºäÈ­¸é¿¡¼­ ÀÓÀÇ µµ¸ÞÀÎÀ» Á¦¿ÜÇÑ »çÀÌÆ®´Â ¿ÜºÎ ºê¶ó¿ìÀú·Î
1,228
android webview url °¡·Îä±â / ³×ÀÌƼºê¿¡¼­ ÀÛ¾÷ | android
1,227
µð¹ÙÀ̽º ºÎÆýà ¾Û ½ÇÇàÇÏ´Â ¹æ¹ý / ÀçºÎÆà ½Ã ¾îÇà ½ÇÇàÇÏ´Â ¹æ¹ý
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.