Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filename = "test.txt"
- regex = Regexp.new("asdf")
- File.open(filename, "r"){|aFile| aFile.each_line {|line| puts line if line =~ regex}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement