Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Regular Expressions in JavaScript Regular Expressions Excluding Characters

1 Answer

Megan Amendola
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Megan Amendola
Treehouse Teacher

In regex, + means it is looking for one or more while * means it is looking for zero or more.

I like to play around with my Regex on this site to check how it is working and test my work.

karan Badhwar
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
karan Badhwar
Web Development Techdegree Graduate 18,135 Points

Hi Megan Amendola, Thankyou for your response. Actually, the results were weird, if I go as per the video and just change the + to *. The results were different. Where with + it was showing 3 matches, but with * it was 4 that's what I did not understand. I tried on the website given by you with

[^@.]+ 
[^@.]* 

and the string was

toy@boat.com

With the First I got 3 matches, but with the second I got a warning.