Hi All!

If I have regular expression and some text.
How can I get positions of matches?

my $text = <<END;
Accession Cvi-1 was identified as hypo-SA-responsive at both levels. Cvi-1 was shown previously to be hyporesponsive to methyl jasmonate (MeJa) according to both transcript accumulation and ozone sensitivity (Rao and Davis, 1999; Rao et al., 2000). MeJa and SA signaling are generally assumed to be mutually antagonistic, so it is interesting to observe an accession that is hyporesponsive to both hormones (Kunkel and Brooks, 2002).
END

$regex = qr/\(.*?\d+?.*?\)|\[.*?\d+?.*?\]/msx

my @matches = $text =~ /$regex/g;
foreach my $arr (@matches)
{
       print "$arr\n" if defined $arr;
}




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to