$string = "s005219/Doe John|John.Doe\\"; $string = ~/s\d+\/([^|]*)/; print $1