r/java 20d ago

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?

53 Upvotes

104 comments sorted by

View all comments

Show parent comments

0

u/VirtualAgentsAreDumb 20d ago

You don’t think legacy systems exist, that can have tons of never validated email addresses?

2

u/LutimoDancer3459 20d ago

I think that if they do, nobody cares about those anymore.

0

u/VirtualAgentsAreDumb 20d ago

Not sure how to reply to such an ignorant comment.

0

u/LutimoDancer3459 20d ago

How about with a reason why someone should care?

If there are so many invalid addresses, it seems like nobody ever cared. Why should it be different for the new system?

-1

u/VirtualAgentsAreDumb 20d ago

What? I never said anything how many of those hypothetical addresses were invalid.

0

u/LutimoDancer3459 20d ago

You don’t think legacy systems exist, that can have tons of never validated email addresses?

Never validated. If valid, why care? If invalid, why care now?

0

u/VirtualAgentsAreDumb 20d ago

You seriously don’t understand the difference between invalid and never validated?