my ($uid) = $string =~ /^UID: (\w+)/; print $fh $uid if $uid;