3 ms·
Indeed I do the same kind of distinction with the exact same naming convention. Now this does not detract to the fact that this regex is quite elegant in its s
by lloeki 16y ago
Indeed I do the same kind of distinction with the exact same naming convention.
Now this does not detract to the fact that this regex is quite elegant in its simplicity and we often assume our hardware+software stack to be actual Turing machines.
Call me paranoid but finding such a simple expression and seeing it validate a number being a prime in such record times should have raised some alarms. Indeed, removing the "optimization" makes computing times go through the roof.
- lukeschlather 16y agoI think you've completely missed the point of the exercise. This is not about optimization. It's about having a deep knowledge of how Perl-style regular expressions work.
- lloeki 16y agoSorry, this was not my intention to mean so: I used "optimization" for lack of finding the correct word regarding the role of the PCRE setting. My point was that the quickness of the initial results was fishy enough to doubt of the correctness of those results (and hence diving into regex engine probing), even before finding actual false positives.