http://qs321.pair.com?node_id=651398


in reply to Match and Extract String with Regex

If you just want to extract the TAIR id, you could use this regex:
my ($tair_id) = $str2 =~ /(AT\dG\d{5})/i;
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}(?:\.\d+)?)/i;