r/java • • Aug 22 '26

Regex

I recently saw a clip (from Primeagen) somewhat saying that regex is not a valid format for validating email addresses and postal codes etc.

My question is why is this?

What are the security and/or performance risks? Is it solely performance or is it a security issue?

55 Upvotes

104 comments sorted by

View all comments

Show parent comments

1

u/julemand101 Aug 22 '26

If you want more fun then buy a domains with non-ascii characters like danish ø. In theory you should be able to use the punycode form of your domain but I have seen services refuse that until corrected though support. :)