Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ruby is terser, and yet still very readable. In addition, you will not be getting any performance gain by using a JAVA regex over a ruby regex unless you are using a DFA implementation (if there is one for JAVA), in which case you won't get text capturing.

How many lines of Java code would it take you to read a file given on the command line and print out the prefixes of words ending in 'ing'

ARGF.readlines.each do |line| puts m[1] if( m = line.match(/(\w+)(?:ing)$/) ) end



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: