You could try something like this
use v5.14; use warnings; my @values = ( qw/XYZATGCACGTGFVGFCCV YZXCVFDCXZATGCXCCXZZSDD/); for my $v (@values) { my ($pre) = $v =~ m/^(.*?)ATGC/; say $pre; }
In reply to Re: pattern matching
by RichardK
in thread pattern matching
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |