Barcelona forward Lionel Messi is set to miss the rest of the season after tests revealed the extent of the damage to his right hamstring.