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

Re: regexp and valid-sre?

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.

On 11/26/2013 10:19 AM, Peter Bex wrote:
On Tue, Nov 26, 2013 at 10:00:10AM -0800, Michael Montague wrote:
I don't think that these are strong arguments for having 'valid-sre?'.
An implementation for which compiling is expensive, could easily
internally do the "is it valid"-type check before compiling. Having it
in the interface adds no functionality that is not already easily available.
You're missing the part where I said "on-the-fly".  If it _is_ valid,
this will be unacceptably slow if you're only interested in providing
feedback to the user whether their currently entered expression is
valid or not.  I don't think this feature is far-fetched: programs
like RegexBuddy do this, and an enhanced Scheme IDE could also do
something like that.

On today's computers, how complex would the regular expression have to be for it to be unacceptably slow? For it to be slow enough for a person to notice in interactive use?

I have implemented a NFA regular expression package, but never a DFA one.