3 ms·
Or ARGF.each {|line| line.scan(/\b\w+ing\b/).each(&:puts) } You know, why are we breaking this by line? :P ARGF.read.scan(/\b\w+ing\b/).e
by epochwolf 16y ago
Or
ARGF.each {|line|
line.scan(/\b\w+ing\b/).each(&:puts)
}
You know, why are we breaking this by line? :P
ARGF.read.scan(/\b\w+ing\b/).each(&:puts)
Probably requires ActiveSupport for some versions of ruby :) The &:symbol trick isn't in all versions.