Hi, I want to implement a generic Regex validator for a generic email, like "aaa@aaa.com", but I can't get it to work, this is the one I used to apply always:
"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}\$"
But if I try to use that one directly, I get this error: Parse error: Invalid escape sequence
Therefore, to solve this error I have transformed it into the following:
"^[\w\-\.]+@[\w\-]+\.[\w\-]{2,4}$"
But it's still not working correctly, and I think it may be in the way that I'm trying to get the text and validate it.
This is the code (inside the same function):
var regex = RegEx.new()
regex.compile("^[\w\-\.]+@[\w\-]+\.[\w\-]{2,4}$")
...
elif regex.search(emailRegisterField.text.strip_edges()):
emailRegisterMessage.text = "EMAIL_INCORRECT"
emailRegisterMessage.visible = true