E-mail address regex / regexp pattern

The whole e-mail address regexp pattern thing is much more complex than just a .*@.* and there are a lot of different variations. However this one is the HTML5 spec regex pattern:


...as of 2012-01-10. It works well together with RequestFactory's onConstraintViolation.

message = "Invalid mail address.",
regexp = "^[a-zA-Z0-9.!#$%&'*+/=?\\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$"
private String mail;


Popular posts from this blog

Tuning ext4 for performance with emphasis on SSD usage

Rust’s impact on the industry

Brandan Eich on WebAssembly, Web Workers, and Decorators