News for hackers. Stuff that matters.
Re:Java-based Startups, do they exist? by Tichy on Tuesday September 04, 2007 @04:18AM (#49905)
I actually like the regexp implementation of Java, and it is more complete than in most other languages. There are also many options for XML parsers. Where does the advantage for Ruby lie?
Re:Java-based Startups, do they exist? by gregwebs on Tuesday September 04, 2007 @01:07PM (#50028)
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