I'm not sure how that's relevant. Even given infinite space, there still wouldn't exist a Regular Expression (the CS kind) you could write down in finite time that would match only primes.
At least IIRC, it's been a 20+ years since I last took a Discrete Math course :)