News for hackers. Stuff that matters.
Re:Python code to solve xkcd 1313 by Peter Norvig by drdeca on Tuesday January 07, 2014 @02:37AM (#7016164)
If a regex is required to only match x if p(x), is the regex required to match ALL x such that p(x)?

Although this is probably just pointless nitpicking on my part.

Re:Python code to solve xkcd 1313 by Peter Norvig by jakobsen on Tuesday January 07, 2014 @01:31PM (#7018882)
Of course it is required (within the computational limits of your computer, of course)

If p(x) means 'x is an integer', you could use the regex /^1$/ since it matches integers only (in particular, the integer 1). That's not sufficient, you need to match all integers.

edited:format

Re:Python code to solve xkcd 1313 by Peter Norvig by algorias on Tuesday January 07, 2014 @01:49PM (#7019017)
It's required to match all such x, otherwise the empty regex "" trivially satisfies the requirement.