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!
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
This is my solution for the practice:
Match "img_0" followed by a number, then a dot, then either "jpg", "png" or "gif":
Match "pro" followed by either "jec", "trac" or "c" then followed by "tor":
Match "img_" followed by either "sm" or "0<and a number>", then followed by either "_0<and a number>" or nothing, then followed by a dot, then followed by either "jpg" or "png":
Match either "www" or "api" followed by a dot, or nothing at all, then followed by either "github" or "teamtreehouse", then followed by a dot then followed by "com":
Hope this helps!
I know this lesson was on grouping, but it seems like overkill for numbers 3 and 4. For number 3, all the ones to include had "img_" and something, and the one to exclude didn't have an underscore, so
img_.+ works for the given test cases. Again, with number 4, all the grouping seems like overkill, as the ones to be excluded end in ".net" and the ones to match end in ".com", so
.+\.com$ gets all but the ones ending in ".net". It would be nice if they gave more explicit details on what to match and exclude, and/or gave broader test sets.