[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

benefits of SRE syntax



Maybe I am being a heretic, but what are the benefits of the SRE syntax?

The beginning of the rational notes that "regular expressions are the lingua franca of string matching today". Part of that lingua franca is the traditional syntax of regular expressions.

The rational also lists three benefits of the SRE syntax:
(1) They are easier to read.
(2) They are easier to extend.
(3) They are both faster and simpler to compile.

On benefit (1): they are more verbose, and readability is subjective. They will look different to anyone who has already learned the traditional syntax of regular expressions.

On benefit (3): some (most?) implementations will compile the SREs to the traditional syntax and use a library like PCRE.

I don't have a sense for the value of benefit (2), maybe it is enough to make the SRE syntax worth it. Benefits (1) and (3) don't seem like strong enough arguments to merit requiring the SRE syntax.

Michael.