Stored Procedure Not working as Expected
That's because you're looking for the string 'qry' instead of the value held by the parameter qry.

Replace:

REGEXP ('^.* qry.$')) 


With

REGEXP CONCAT('^.* ',qry, '.$'))