Matching string name of player to player entity

What do i have to do to match the string of a players name to the actual player after looping through all the players?

For example, there is a variable that is the string “peter”, how do i get the variable to be the actual player, peter?

Main idea you can work from:
[lua]
if string.find(string.lower(PlayerName), string.lower(PartOfPlayersName)) then
-return player/players
end
[/lua]