Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: extract only uppercases from string

by Anonymous Monk
on Aug 23, 2012 at 10:56 UTC ( [id://989277]=note: print w/replies, xml ) Need Help??


in reply to Re^2: extract only uppercases from string
in thread extract only uppercases from string

#!/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"]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://989277]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found