Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Splitting only on internal pattern, not at start or end of string

by oiskuu (Friar)
on Jan 16, 2014 at 10:27 UTC ( #1070788=note: print w/ replies, xml ) Need Help??


in reply to Splitting only on internal pattern, not at start or end of string

The pattern for split isn't terribly complicated either:

my @contigs = split /(?<=[^N])N++\B/, $sequence{$key};
Update: /[^N]\KN++\B/ with a \K will also work, as long as you don't capture the gaps.


Comment on Re: Splitting only on internal pattern, not at start or end of string
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2015-07-28 05:17 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 (252 votes), past polls