in reply to Match and Extract String with Regex
If you just want to extract the TAIR id, you could use this regex:
If you want to fetch the alternative splice form suffixes as well (e.g. AT1G71260.1), you could use:my ($tair_id) = $str2 =~ /(AT\dG\d{5})/i;
my ($tair_id) = $str2 =~ /(AT\dG\d{5}(?:\.\d+)?)/i;
In Section
Seekers of Perl Wisdom