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 Finding Repeated Characters

How can I do the second exercise?

Hi, guys.

I'm trying to do the second exercise, but I just got to this point \d\s\w{3,6}\s? \d\s\w{3,6}\s?\w{6} I can't include the 2 pie slices without exclude the other ones.

thanks

6 Answers

I figured it out, but I'll not delete the question, just in case someone else has the same problem

I made it with a couple of (), like this.

\d\s\w{3,6}\s?(\w{6})?

Hope this helps someone

Thank you for keeping this posted!

I achieved it using : \d\s\w*\s?\w* OR \d\s\w+\s?\w+

it will select all of these: 8 pieces 7 piece 6 pieces 5 pieces 4 pieces 2 pie slices