Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: cleaving a sequence with specific alphabets

by prasadbabu (Prior)
on May 21, 2008 at 11:16 UTC ( #687747=note: print w/ replies, xml ) Need Help??


in reply to cleaving a sequence with specific alphabets

If I understood your question clearly, here is my solution. You can use negative look behind regex and split function to accomplsh it. TIMTOWTDI.

$string = 'APADPKGSTIDRPDAARTLTVHKCEQTDTRGVKEGTRNEDPQAECKPVSDVEFTITKLN +VD'; @arr = split /(?<!P)(K|R)/, $string; print @arr; output: ------- APADPKGSTIDRPDAARTLTVHKCEQTDTRGVKEGTRNEDPQAECKPVSDVEFTITKLNVD

Take a look at perlre and split function.

Prasad


Comment on Re: cleaving a sequence with specific alphabets
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (15)
As of 2015-07-06 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (77 votes), past polls