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 trialManish Giri
16,266 PointsRegex - * is zero or more, not one or more?
At about 3:40 min, Craig says *
in Regex means one or more of the character. But if I remember correctly, +
represents one or more, while *
represents zero or more.
Can someone confirm?
3 Answers
Daniel Phillips
26,940 PointsTo be clear, * means match the previous character (or group) zero or more times
carlorigacci
4,777 PointsYes, he messed up. The asterisk(*) means zero or more.
Nicholas Grenwalt
46,626 PointsI confirm. * is zero or one.