Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

I'd write a kick-ass regular expression engine.

http://perl.plover.com/NPC/NPC-3SAT.html



sort by: page size:

Oh, neat.

Perl 6 appears to have assimilated that idea: http://doc.perl6.org/language/regexes#Subrules


The perl version of regexps is np-hard...

https://perl.plover.com/NPC/


see also, Perl Regular Expression Matching is NP-Hard: https://perl.plover.com/NPC/

Oh yeah, let's write a parser for html, because regex is too hard https://blog.codinghorror.com/parsing-html-the-cthulhu-way/

This problem is also fun with perl regexes

http://www.perlmonks.org/?node_id=297616


Like almost everything to do with regexes, Perl did it first: http://perldoc.perl.org/perlre.html#%2fx .

Oh that has already been done too, using perl :) http://stackoverflow.com/questions/4231382/regular-expressio... (Check the answer from tchrist)

Your colleague may be interested in pcre (perl compatible regular expressions) see http://www.pcre.org

But I agree, C isn't the best choice for that task.


This reminds me a lot of the regular expression reAnimator: http://osteele.com/tools/reanimator/.

I use that to generate my regular expressions and test them :

http://www.ultrapico.com/Expresso.htm


This may be enough to make the Perl-style regexes comprehensible:

https://perldoc.perl.org/perlre#Character-Classes-and-other-...


REGEX in Perl 6 looks pretty amazing: https://docs.perl6.org/language/regexes

Probably the first step would be a good, non-regular-expression (IIRC, URLs are not regular) based link parser that's ported to every possible language on the planet.

Albeit the typical first reaction might be that of XKCD 927 (I must confess it was mine, at least), I believe that the regular expressions area is territory that could see some innovation. If told to pick just one feature from eggex, I'd choose the ability to parse statically!

FWIW I think this deserves a submission of its own, so here it is:

https://news.ycombinator.com/item?id=26408510



Perl Regular Expression Matching is NP-Hard

https://perl.plover.com/NPC/


I'm working on making my ideal tool: http://www.reverberate.org/gazelle/

It's been a long time coming, but I believe very strongly in it.

"pain in the ass to integrate" -- I can sympathize. I'm working tirelessly to make this as easy to integrate as regexes are in Perl, Python, Ruby, etc.


> Still it makes me want to write an SKI interpreter.

How about in Perl-style regexes? http://www.perlmonks.org/?node_id=809842


Depends what you mean by "regular expression," but matching in perl regexps is NP-Hard.

https://perl.plover.com/NPC/

next

Legal | privacy