in reply to Regex puzzle for you

add a "?":
print '__xxx__' =~ /\b_+(\w+?)_+\b/ ? "$1\n" : "no match\n";