Illya Gerasymchuk personal blog
Demystifying the regular expression that checks if a number is prime (2016)
Ever wondered how the ^.?$|^(..+?)\1+$ regular expression can tell you if a number is not prime? In this blog post you'll learn how and why it works. Code examples in Java, JavaScript, Python and Perl are provided.
- Points
- 159
- HN comments
- 47
- Submissions
- 1
- Cited by
- 0 commenters
Math & AlgorithmsSoftware Engineering2024
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| Oct 31, 2024 | Demystifying the regular expression that checks if a number is prime (2016) by aquir | 159 | 47 |