I need a function that can extract string starting with "$" and ending with " ' " or "," or nothing

Suppose string is

efgh = '$EXPCH.nmo' AND tree = $Name, tree = $pcd

it should return me
EXPCH.nmo
Name
pcd

Any help please...