<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
 <channel>
  <title>語句ログ - ニュース、プログラミング、システムトレードの用語解説</title>
  <link>https://59log.com/</link>
  <description>日本の注目ニュース、コンピュータープログラミング（C/C++,Perl,PHP,SQL）、システムトレード（FX,CFD,株価指数,先物）に関する語句（Word）を日本語や英語で解説</description>
  <lastBuildDate>Mon, 04 May 2026 04:27:36 +0900</lastBuildDate>
  <pubDate>Mon, 04 May 2026 04:27:36 +0900</pubDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>59Tracker 3.2</generator>
  <item>
    <title>[Perl]http URL の正規表現について</title>
    <description>コメント内のURLを自動的にリンクする処理の正規表現が、よく見るとかなり怪しかったの少し調べてみたのですが、それほど正確でなくてもいいと言うのであれば、&lt;br /&gt;&lt;br /&gt;s?https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&amp;=+\$,%#]+&lt;br /&gt;&lt;br /&gt;で良いみたいです。&lt;br /&gt;&lt;br /&gt;なので、PerlでURLを自動的にリンクする処理は以下のような感じになります。&lt;br /&gt;&lt;br /&gt;my $pattern = &quot;s?https?://[-_.!~*'()a-zA-Z0-9;/?:@&amp;=+$,%#]+&quot;;&lt;br /&gt;$text =~ s/($pattern)/&amp;lt;a href=&quot;$1&quot;&amp;gt;$1&amp;lt;\/a&amp;gt;/g;&lt;br /&gt;&lt;br /&gt;ちなみに、正確なhttp URL の正規表現はこうらしい。&lt;br /&gt;&lt;br /&gt;my $digit = q{[0-9]};&lt;br /&gt;my $upalpha = q{[A-Z]};&lt;br /&gt;my $lowalpha = q{[a-z]};&lt;br /&gt;my $alpha = qq{(?:$lowalpha|$upalpha)};&lt;br /&gt;my $alphanum = qq{(?:$alpha|$digit)};&lt;br /&gt;my $hex = qq{(?:$digit|[A-Fa-f])};&lt;br /&gt;my $escaped = qq{%$hex$hex};&lt;br /&gt;my $mark = q{[-_.!~*'()]};&lt;br /&gt;my $unreserved = qq{(?:$alphanum|$mark)};&lt;br /&gt;my $reserved = q{[;/?:@&amp;=+$,]};&lt;br /&gt;my $uric = qq{(?:$reserved|$unreserved|$escaped)};&lt;br /&gt;my $query = qq{$uric*};&lt;br /&gt;my $pchar = qq{(?:$unreserved|$escaped|} . q{[:@&amp;=+$,])};&lt;br /&gt;my $param = qq{$pchar*};&lt;br /&gt;my $segment = qq{$pchar*(?:;$param)*};&lt;br /&gt;my $path_segments = qq{$segment(?:/$segment)*};&lt;br /&gt;my $abs_path = qq{/$path_segments};&lt;br /&gt;my $port = qq{$digit*};&lt;br /&gt;my $IPv4address = qq{$digit+\\.$digit+\\.$digit+\\.$digit+};&lt;br /&gt;my $toplabel = qq{(?:$alpha|$alpha(?:$alphanum|-)*$alphanum)};&lt;br /&gt;my $domainlabel = qq{(?:$alphanum|$alphanum(?:$alphanum|-)*$alphanum)};&lt;br /&gt;my $hostname = qq{(?:$domainlabel\\.)*$toplabel\\.?};&lt;br /&gt;my $host = qq{(?:$hostname|$IPv4address)};&lt;br /&gt;my $http_URL = qq{http://$host(?::$port)?(?:$abs_path(?:\\?$query)?)?};&lt;br /&gt;my $pattern = $http_URL;&lt;br /&gt;&lt;br /&gt;ぐはっ！&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.din.or.jp/~ohzaki/perl.htm#httpURL&quot; target=&quot;_blank&quot;&gt;http://www.din.or.jp/~ohzaki/perl.htm#httpURL&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://59log.com/?func=detail&amp;amp;id=1792#link&quot; target=&quot;_blank&quot;&gt;Link(2)&lt;/a&gt; | &lt;a href=&quot;https://59log.com/?func=detail&amp;amp;id=1792#trackback&quot; target=&quot;_blank&quot;&gt;Trackback(0)&lt;/a&gt; | &lt;a href=&quot;https://59log.com/?func=detail&amp;amp;id=1792#comment&quot; target=&quot;_blank&quot;&gt;Comment(0)&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;h3&gt;キーワード&lt;/h3&gt;&lt;p&gt;&lt;em&gt;&lt;a href=&quot;https://59log.com/?q=Perl&quot; title=&quot;Perl&quot;&gt;Perl&lt;/a&gt;&lt;/em&gt;&amp;nbsp;&lt;em&gt;&lt;a href=&quot;https://59log.com/?q=URL&quot; title=&quot;URL&quot;&gt;URL&lt;/a&gt;&lt;/em&gt;&amp;nbsp;&lt;em&gt;&lt;a href=&quot;https://59log.com/?q=%E6%AD%A3%E8%A6%8F%E8%A1%A8%E7%8F%BE&quot; title=&quot;正規表現&quot;&gt;正規表現&lt;/a&gt;&lt;/em&gt;&amp;nbsp;&lt;em&gt;&lt;a href=&quot;https://59log.com/?q=http&quot; title=&quot;http&quot;&gt;http&lt;/a&gt;&lt;/em&gt;&amp;nbsp;&lt;em&gt;&lt;a href=&quot;https://59log.com/?q=%E8%87%AA%E5%8B%95%E3%83%AA%E3%83%B3%E3%82%AF&quot; title=&quot;自動リンク&quot;&gt;自動リンク&lt;/a&gt;&lt;/em&gt;&amp;nbsp;&lt;/p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://59log.com/&quot;&gt;語句ログ - ニュース、プログラミング、システムトレードの用語解説 - 日本の注目ニュース、コンピュータープログラミング（C/C++,Perl,PHP,SQL）、システムトレード（FX,CFD,株価指数,先物）に関する語句（Word）を日本語や英語で解説&lt;/a&gt;&lt;/p&gt;</description>
    <link>https://59log.com/?func=detail&amp;id=1792</link>
    <pubDate>Mon, 22 Mar 2010 14:48:13 +0900</pubDate>
  </item>

 </channel>
</rss>
