Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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 karan
seal-mask
.a{fill-rule:evenodd;}techdegree
karan karan
Web Development Techdegree Student 7,016 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.