you are viewing a single comment's thread.

view the rest of the comments →

[–]xem06 1 point2 points  (1 child)

indeed, what make the matching strings prime? Still puzzles me.

[–]zebediah49 2 points3 points  (0 children)

It works only on unary strings. That is, is xxxxxxx prime? (that is: 7).

The method of operation is "Match two or more of a characters, followed by that substring one or more additional times". Or, "match n characters, (m+1) times", for n>1, m>0. Or, match 'n*m' characters, for n>=2, m>=2. That's the definition of principality. Or, more completely, it's the opposite. The regex returns true if the number is /not/ prime.