[Tween-svn] [1076] URL自動認識を修正

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2010年 11月 16日 (火) 21:24:27 JST


Revision: 1076
          http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1076
Author:   syo68k
Date:     2010-11-16 21:24:26 +0900 (Tue, 16 Nov 2010)

Log Message:
-----------
URL自動認識を修正

Modified Paths:
--------------
    trunk/Tween/Tween.vb


-------------- next part --------------
Modified: trunk/Tween/Tween.vb
===================================================================
--- trunk/Tween/Tween.vb	2010-11-16 12:20:27 UTC (rev 1075)
+++ trunk/Tween/Tween.vb	2010-11-16 12:24:26 UTC (rev 1076)
@@ -7499,12 +7499,16 @@
 
     Private Function UrlConvert(ByVal Converter_Type As UrlConverter) As Boolean
         'Converter_Type=Nicomsの場合は、nicovideoのみ短縮する
+        '参考資料 RFC3986 Uniform Resource Identifier (URI): Generic Syntax
+        'Appendix A.  Collected ABNF for URI
+        'http://www.ietf.org/rfc/rfc3986.txt
+
         Dim result As String = ""
         Const url As String = "(?<before>(?:[^\""':!=]|^|\:))" + _
                                    "(?<url>(?<protocol>https?://)" + _
                                    "(?<domain>(?:[\.-]|[^\p{P}\s])+\.[a-z]{2,}(?::[0-9]+)?)" + _
-                                   "(?<path>/[a-z0-9!*'();:&=+$/%#\[\]\-_.,~@^]*[a-z0-9)=#/]?)?" + _
-                                   "(?<query>\?[a-z0-9!*'();:&=+$/%#\[\]\-_.,~@?]*[a-z0-9_&=#/])?)"
+                                   "(?<path>/[a-z0-9!*'();:&=+$/%#\-_.,~@]*[a-z0-9)=#/]?)?" + _
+                                   "(?<query>\?[a-z0-9!*'();:&=+$/%#\-_.,~@?]*[a-z0-9_&=#/])?)"
 
         Const nico As String = "^https?://[a-z]+\.(nicovideo|niconicommons|nicolive)\.jp/[a-z]+/[a-z0-9]+$"
 



Tween-svn メーリングリストの案内
Zurück zum Archiv-Index