Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'benchmark'
- Benchmark.bm do |x|
- x.report do
- t = "Holy shit! I THINK I JUST SAW A ZUNE. This is a sign from the elder gods that means my trip shall bring me good fortune, right?"
- t = t.gsub(/(^|\s+)(?:I|me)([[:punct:]]|\s+|$)/i,' you ')
- end
- x.report do
- t = "Holy shit! I THINK I JUST SAW A ZUNE. This is a sign from the elder gods that means my trip shall bring me good fortune, right?"
- t.gsub!(/(^|\s+)(?:I|me)([[:punct:]]|\s+|$)/i,' you ')
- end
- end
- # user system total real
- # 0.000000 0.000000 0.000000 ( 0.000053)
- # 0.000000 0.000000 0.000000 ( 0.000040)
Add Comment
Please, Sign In to add comment