Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Can split split against more than one character in a string of the same character?

by johngg (Canon)
on Jul 15, 2019 at 22:12 UTC ( #11102899=note: print w/replies, xml ) Need Help??


in reply to Can split split against more than one character in a string of the same character?

Another approach would be to use unpack.

johngg@shiraz:~/perl/Monks$ perl -Mstrict -Mwarnings -E ' my $str = q{aaaaaaaaa}; my @parts = unpack q{(a2)*}, $str; say qq{@parts};' aa aa aa aa a

I hope this is helpful.

Cheers,

JohnGG

  • Comment on Re: Can split split against more than one character in a string of the same character?
  • Download Code

Replies are listed 'Best First'.
Re^2: Can split split against more than one character in a string of the same character?
by Don Coyote (Friar) on Jul 15, 2019 at 22:35 UTC

    That looks fast!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2020-05-29 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (170 votes). Check out past polls.

    Notices?