Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Regular Expressions in JavaScript!
You have completed Regular Expressions in JavaScript!
Preview
Validate an email using a regular expression.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
A string of characters followed by an @
sign, another string of characters,
0:00
a dot, and then some top-level
domain like com or net.
0:02
Why don't you pause the video here and
0:06
try to complete the email
validation yourself first?
0:08
Then, I'll show you my solution.
0:11
So to start with,
0:14
I'm going to add the things that
we know we're gonna have to have.
0:15
So I'll put a regular expression,
and then I'll call test on it, and
0:20
pass in email, and then I wanna
return this from our function.
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up