Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: help with regex

by hdb (Monsignor)
on Mar 20, 2019 at 08:16 UTC ( #1231479=note: print w/replies, xml ) Need Help??


in reply to help with regex

split can also capture. So if you want all the pieces, the G-strings and the other bits, it could work like this

use strict; use warnings; my $line = "GGCTTTCCGTTGTTGCTGGGTGTGGGGGGCGGGCGAGATTGGAAGAGCACACGTCTGA +ACTCCAGTCACGCCAATATCTCGTATGCCGTCTTCTGCTTGAAAAAAGGGGTGGGGGGGAGGGGGGGCG +GGGGGGGGGGGGGGAGGGGGGGAG"; my @pieces = split /(G{10,})/, $line; print "$_\n" for @pieces;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2023-12-02 06:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (13 votes). Check out past polls.

    Notices?