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

benefits of SRE syntax

This page is part of the web mail archives of SRFI 115 from before July 7th, 2015. The new archives for SRFI 115 contain all messages, not just those from before July 7th, 2015.

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.