Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Split on every second character

by ikegami (Patriarch)
on Feb 12, 2010 at 23:06 UTC ( [id://822951]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -E'say for split /(?!^|\z)(?(?{ pos()%2 })(?!))/, "0102030405"'
    01
    ...
    04
    05
    06
    
  2. or download this
    $ perl -E'say for "0102030405" =~ /(..?)/sg'
    01
    ...
    04
    05
    06
    

Log In?
Username:
Password:

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

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

    No recent polls found