If you want to match at least the same number, but it's okay to gobble up more:

/(x+)(y+)(?(?{ length $2 < length $1 })(?!))/x

Make it != if both matches must be the exact same length.

Makeshifts last the longest.

In reply to Re: I wonder... by Aristotle
in thread Things you think you'll never use. by redlemon

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":