News for hackers. Stuff that matters.
Re:My favorite regex of all time by lubutu on Monday November 12, 2012 @07:33PM (#4775581)
I do dislike people calling that expression a "regex", because it isn't: regular expressions cannot contain backreferences, and must be computable in linear time, whereas primality tests are polynomial.
Re:My favorite regex of all time by boyter on Monday November 12, 2012 @08:25PM (#4775770)
While I agree I believe this comment by _delirium sums this up rather well,

http://news.ycombinator.com/item?id=1486502

full comment thread here http://news.ycombinator.com/item?id=1486158

Re:My favorite regex of all time by lubutu on Monday November 12, 2012 @08:43PM (#4775837)
I agree more with philh's response that there is no alternative term for the true meaning of "regular expression" — a regular language, as suggested by _delirium, is not the same thing.

I suppose I could accept "regex" as not being a regular expression as such, but the two are used so interchangeably that maintaining a distinction isn't very realistic. I'd personally rather a regular expression described a regular language, and "PCRE" (or so) used for the Turing-complete expressions with a similar syntax.

Re:My favorite regex of all time by baddox on Tuesday November 13, 2012 @02:34AM (#4776899)
I'm not a big fan of your explanation. To be more precise, true "regular expressions" are computationally equivalent to deterministic finite automata, which indeed can test an n-character string in O(n) time.
Re:My favorite regex of all time by MileyCyrax on Tuesday November 13, 2012 @03:48AM (#4777087)
NFAs and DFAs both recognise the regular languages (and only them).
Re:My favorite regex of all time by laumars on Tuesday November 13, 2012 @04:06AM (#4777139)
It's PCRE (Perl Compatible Regular Expressions) which is one of the most popular dialects of regex. But AFAIK there's isn't a hard and fast RegEx standard.

So I'd argue that code is RegEx.

I guess it's just a matter of perspective though.