fP and regex
Fairlight
fairlite at fairlite.com
Tue Oct 2 12:53:17 PDT 2007
Hola,
I have been toying with the idea of writing a regular expression module for
filePro for a few weeks, on and off, spurred by someone's comment to Jose
to, "Write something that's REALLY NEEDED." I've longed for RE in fP for
over a decade. Finally got around to some preliminary research today as to
the feasibility of doing so, and how to go about starting.
Interesting read at: http://swtch.com/%7Ersc/regexp/regexp1.html
Now, for one, I was mortified to see almost every higher level language
uses an inferior algorithm--including my sacred perl, as well as python,
ruby, and php (pcre is used in php).
On reading this paper, the impression I get is that the NFA approach with
multiple states in linear time is not feasible in fP processing, due to the
lack of structures, linked lists, or even non-finite arrays.
Is this conclusion valid?
The only way I can see to implement a linear time model in fP would
involve using a table on disk to store related states, which may be
arguably slower than the DFA exponential time model, given the overhead of
indexes, disk I/O, etc.
Heck, is it worth writing any model of it for fP? Would anyone here pay
for the ability to use regex as a processing module? If so, how much?
mark->
--
Most people think the defining traits of human beings are intelligence,
speech, writing, or creativity. The sad reality is that the most singular
defining quality of humanity is cruelty. No other species appears to be so
able and willing to inflict pain on its brethren for no logical reason.
More information about the Filepro-list
mailing list