#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; $_ = 'G_I1E2_GTGGAG^303CTGgacgCCCTGC_I2E3_TACA'; my @matches = ""; while( m{ ([ACTG]+)# $1 is upper | ([actg]+) # $2 is lower }gxsm ){ if( $1 ){ $matches[-1] .= $1; } if( $2 ){ push @matches, ""; } } dd \@matches; __END__ ["GGTGGAGCTG", "CCCTGCTACA"]
In reply to Re^3: extract only uppercases from string
by Anonymous Monk
in thread extract only uppercases from string
by losher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |