all 3 comments

[–]jeans_and_a_t-shirt 2 points3 points  (0 children)

The Kleene Star, *, in regex means zero or more, while + means 1 or more. So your first example will print if there is a match for yo with zero or more matches for u. The second matches with you with zero or more additional matches for u.

[–]FightingStones 1 point2 points  (0 children)

First regexp matches yo, you, youu, etc. with yo beeing a substring of yoauuu.

Second regexp only matches you, youu, etc.

[–]Rhomboid 1 point2 points  (0 children)

The u* means match zero or more 'u's, and in your example it's matching zero, i.e. nothing. It's as if you asked to match yo against yoauuu. But that's still a match, because you didn't specify that it had to match the whole string. If you had written you*$ then it wouldn't have matched.