Email pattern

I still don’t understand pattern matching, so can any of you tell me what the best pattern is to check if a string is in email format?

**This **will help. I learned pretty much all I needed to know in 1 hour.

As for your email pattern; there are several valid patterns. Here is a good one:


^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$

oh god. I really need to learn regular expressions.

Uhh… that won’t work. Lua patterns are NOT the same as regular expressions, not even near.

Use this one:


[A-Za-z0-9%.%%%+%-]+@[A-Za-z0-9%.%%%+%-]+%.%w%w%w?%w?

Shit. I was preferring regular expressions :frowning:

Awwww :saddowns:

Perfect, thanks.