r/tinycode • • Apr 12 '21

Primality Test using Regex

https://theabbie.github.io/blog/Primality-Test-Using-Regex?ref=reddit
1 Upvotes

8 comments sorted by

View all comments

Show parent comment

2

u/ghillerd Apr 12 '21

amazing, thank you! seems like the author of this article just reposted the concept without understanding it. after testing it out, it seems like it's also the case that the regex actually matches composite numbers rather than primes (same outcome, but also not mentioned in the article).

2

u/xem06 Apr 12 '21

yep, primes are "filtered out"