I was studying java and the course instructor left me a challenge to validate an email using regular expressions.
I researched the regex API documentation ... part of the pattern .. The problem is that I found a code on the internet (which worked, of course) .. like this:
String regex = "[A-Za-z0-9\._-]+@[A-Za-z0-9]+(\.[A-Za-z]+)*";
In this case, I did not understand just why he put the characters "[" and "]," ("and") ", as well as the" \ "(which I know backslash, but I did not understand why it was used in this code.
Does anyone know?