Changeset 19735 for lang/ruby

Show
Ignore:
Timestamp:
09/22/08 21:21:18 (2 months ago)
Author:
mtv
Message:

modified regexp for the case that multiple <a href>...</a> exist in one line

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/robot-twitter/trunk/robot-twitter.rb

    r19714 r19735  
    3939 
    4040    # リンクは ... で省略されるので url に置き換える 
    41     content = content.gsub(%r{<a\s+href="([^"]*)"\s+rel="[^"]*"[^>]*>.*</a>}m, '\1') 
     41    content = content.gsub(%r{<a\s+href="([^"]*?)"\s+rel="[^"]*?"[^>]*?>.*?</a>}m, '\1') 
    4242 
    4343    # @username のリンクを外す 
    44     content = content.gsub(%r{<a\s+href="[^"]*"[^>]*>(.*)</a>}m, '\1') 
     44    content = content.gsub(%r{<a\s+href="[^"]*?"[^>]*?>(.*?)</a>}m, '\1') 
    4545 
    4646    meta = entry.search('a[@class="entry-date"]').first