Advertisement
Guest User

URLs finden, Ruby

a guest
Aug 28th, 2013
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.26 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2. while gets
  3.     while /\b((https?|ftp|file):\/\/|(www|ftp)\.)[\-A-Z0-9+&@#\/%?=~_|\$!,.;:]*[A-Z0-9+&@#\/%=~_|\$]/i
  4.         puts $&
  5.         $_.sub! /\b((https?|ftp|file):\/\/|(www|ftp)\.)[\-A-Z0-9+&@#\/%?=~_|\$!,.;:]*[A-Z0-9+&@#\/%=~_|\$]/i, ''
  6.     end
  7. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement