fork download
  1. #! ruby -Ku
  2. # -*- coding: utf-8 -*-
  3.  
  4. SAMPLE = <<EOD
  5. ガチャピン&ムック
  6. ガチャ&ピン&ムック
  7. http://h...content-available-to-author-only...e.jp/index.html?k=2011&id=0414
  8.  http://h...content-available-to-author-only...e.jp/index.html?k=2011&id=0414
  9.  http://h...content-available-to-author-only...e.jp/index.html?k=2011&id=0414
  10. ⇒http://h...content-available-to-author-only...e.jp/index.html?k=2011&id=0414
  11. EOD
  12.  
  13. SAMPLE.each_line do |line|
  14. puts(
  15. case line
  16. when %r!\w+?p://!
  17. line
  18. else
  19. line.gsub '&', '&'
  20. end
  21. )
  22. end
Success #stdin #stdout 0s 4760KB
stdin
Standard input is empty
stdout
ガチャピン&ムック
ガチャ&ピン&ムック
http://h...content-available-to-author-only...e.jp/index.html?k=2011&id=0414
 http://h...content-available-to-author-only...e.jp/index.html?k=2011&id=0414
 http://h...content-available-to-author-only...e.jp/index.html?k=2011&id=0414
⇒http://h...content-available-to-author-only...e.jp/index.html?k=2011&id=0414