You're viewing a comment by epiphany47 and its responses.

epiphany47 Permalink
December 26, 2011, 08:47

This isn't a "regular expression", it's a "regexp" =] - see comments on HN:
http://news.ycombinator.com/item?id=3391547

This script uses backreferences which give regexp's more "computing power" than regular expressions actually have, but remove the guaranteed runtime of an O(n) regular expression. For more, read the excellent article at http://swtch.com/~rsc/regexp/regexp1.html

You can actually prove that "regular expressions" don't have the computing power to enumerate the prime numbers. For more, read the wiki article, http://en.wikipedia.org/wiki/Pumping_lemma_for_regular_languages

On an unrelated note, I've been a longtime fan of your NodeJS articles, and look forward to more of your writing. =]

Comment Responses

December 26, 2011, 14:10

I have studied computer science intensively and you're right that this regular expression isn't a real regular expression as in automata theory.

I'm publishing the next nodejs post in a few days!

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.