From: syo68k Date: Tue, 16 Nov 2010 12:24:26 +0000 (+0000) Subject: URL自動認識を修正 X-Git-Tag: Tween_v0.9.7.1-beta~96 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a7e641effbfe8e897247e1514f583d8a9838f2b1;p=opentween%2Fopen-tween.git URL自動認識を修正 git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@1076 e39ad16e-3079-482e-bb30-4b4d378143b6 --- diff --git a/Tween/Tween.vb b/Tween/Tween.vb index 5f7c048e..861635ed 100644 --- a/Tween/Tween.vb +++ b/Tween/Tween.vb @@ -7499,12 +7499,16 @@ RETRY: 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 = "(?(?:[^\""':!=]|^|\:))" + _ "(?(?https?://)" + _ "(?(?:[\.-]|[^\p{P}\s])+\.[a-z]{2,}(?::[0-9]+)?)" + _ - "(?/[a-z0-9!*'();:&=+$/%#\[\]\-_.,~@^]*[a-z0-9)=#/]?)?" + _ - "(?\?[a-z0-9!*'();:&=+$/%#\[\]\-_.,~@?]*[a-z0-9_&=#/])?)" + "(?/[a-z0-9!*'();:&=+$/%#\-_.,~@]*[a-z0-9)=#/]?)?" + _ + "(?\?[a-z0-9!*'();:&=+$/%#\-_.,~@?]*[a-z0-9_&=#/])?)" Const nico As String = "^https?://[a-z]+\.(nicovideo|niconicommons|nicolive)\.jp/[a-z]+/[a-z0-9]+$"