tags:

views:

110

answers:

6

Hi,

I am familiar with Perl's strong parsing abilities using regular expressions.

Is it efficient?

What other languages have strong parsing ability and perform efficiently?

+3  A: 

I would say Python.

EDIT: I came across pystring, in case you're working in C++ but seek the flexibility of Python strings.

Gregory Pakosz
+3  A: 

Pretty much all modern languages have regular expressions that are relatively efficient: Java, C#, PHP, Python, even Javascript (amongst others).

cletus
+3  A: 

SNOBOL and Icon are two other languages devoted to manipulate strings. The first one is rather old while the second is not used much.

Anyway, I would start from your problem. Depending what are you trying to achieve (and you constraints) you might discover that even AWK, sed or gema would be a perfect match for your needs. Or not ...

I would dare to say that if parsing is so prominent in your task, you might benefit from using a parser generator (lex/yacc, ANTLR, lemon, ...).

Remo.D
+1  A: 

Most languages these days have fast regexp libraries that you can use for your purposes. Perl's strength is that these are integrated into the language itself so you can do a lot of string processing with just the language core (as opposed to say, Python where it's a separate module).

Noufal Ibrahim
+3  A: 

You can have a look at this benchmark which shows how different programming languages perform with regards to memory consumption and speed.

klausbyskov
excellent link.
But no mention of regex ability
skaffman
+1  A: 

Powerbasic is well worth checking out. They have two versions. The Console Compiler would be ideal if you do not need GUI.

It is not on the Benchmark link above but it is extremely fast. I use it extensively for writing utilities to do specialized tasks.

Square Rig Master