I am trying to make a registration form in Java that accepts a string in the form of: ok@ok.ok, right now, I have -
(email.matches("[^a-zA-Z0-9]+")
which I need it to also accept @, _,-,.
symbols but am unsure how to add it into the regex shown earlier.
As well as this I am aware that there is a way to separate to accept an amount of characters, and then read a specific symbol, (in my case it would be "@" and "." for the email) but am unable to implement it, something along the lines of
(email.matches("[^a-zA-Z0-9]{1-99}[1][@][^a-zA-Z0-9]{1-99}[1][.][^a-zA-Z0-9]+")
Thanks