Retrieve the accession numbers from the names of the target with a regular expression. The accession number is the id between the first two bars. For "sp|Q9V9I4|O42B_DROME", the accession number is "Q9V9I4". Letters, numbers, underscores, dashes and periods may be used in the accession number. No spaces are allowed in the accession number. Because more than two bars may appear in a single name, we need to match the most left bars with "?".
For example,
$Sample = "a xxx c xxxxxxx c xx d";
/a.*c.*d/; # the first ".*" matches all the characters up to the 2nd c.
/a.*?c.*d/; # the "a.*?c" matches the fewest characters between a and c, that's the leftmost c