Re: Ann: regex pack

Michael Hendricks <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFHuXubE_-r5uz-h5YvpNx1zaV3k=qg7hnTahFP53eRUG2Va4A@mail.gmail.com>
On Mon, Sep 16, 2013 at 1:21 AM, Richard A. O'Keefe <[email protected]>wrote:

>
> On 14/09/2013, at 7:49 AM, Michael Hendricks wrote:
>
> > I love DCGs as much as the next Prolog fan, but sometimes a tiny regular
> > expression will do the job.  Or perhaps regular expressions are part of
> > your app's UI.  Anyway, this
> > pack<http://www.swi-prolog.org/pack/list?p=regex>supports many
> > features of Perl compatible regex (see link for full support).
>
> Oh dear.  The huge merit of regular expressions is that they take
> linear time.  The huge defect of Perl irregular expressions is
> that they can take exponential time.
>

Yeah, they can get pretty nasty.  Mark Jason Dominus shows that solving
Perl regular expressions is NP-Hard: http://perl.plover.com/NPC/


> Apart from that, if you can plug re2 in, why would you want
> anything else?
>

Some environments can't call external C libraries so a pure Prolog
implementation is all that's available.


> Didn't Peter Schachte write a regular expression library for Prolog?
>

After several searches, I've been unable to find it.  I'll gladly adopt an
existing, stable implementation if one's available.

-- 
Michael
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.