in reply to regex in perl and Java

I am not comparing Java and perl, but merely saying that, if regex is a key point of using perl in a particular application, that's no longer a very convincing reason
I disagree.

Both Perl and Java are Turing complete, so you can use any feature in any of those languages, provided you invest enough time to get the infrastructure right.

But normally you just don't want to set up your infrastructure, load modules/libraries (and look up their name first), you just want to write something like this:

while (<>) { print if m/^\d/ && m/\d$/; }

If you do that in Java, how many classes do you have to load first? How many classes and objects do you have to declare, and does all that extra line noise make your program more readable?

It's not only important if you can do something, it's also important how you can do it.

Replies are listed 'Best First'.
Re^2: regex in perl and Java
by BerntB (Deacon) on Jul 14, 2008 at 10:09 UTC

    It's not only important if you can do something, it's also important how you can do it.

    Exactly, expressive power. The reason we use higher level languages instead of assembly -- and analogously why script languages like Perl seems to start eating up traditional languages like Java...