I just read this (old) blog entry which was posted to hackernews and thought: Fair enough. Let's do it with Nim!
It is 4:41 am and I have a serious flu. Don't ask! :)
# regular expression to check a number for being prime
import re, strutils
let rprime = re r"^1?$|^(11+?)\1+$"
proc testPrime(n: int): bool =
not (repeatChar(n, '1') =~ rprime)
for n in 1..10_000:
echo n, " is", if not testPrime n: " not" else: "", " prime"
let rprime = re"^1?$|^(11+?)\1+$"