Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.13 KB | None | 0 0
  1. filename = "test.txt"
  2. regex = Regexp.new("asdf")
  3. File.open(filename, "r"){|aFile| aFile.each_line {|line| puts line if line =~ regex}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement