Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Split confusion

by kcott (Archbishop)
on Jun 04, 2020 at 08:30 UTC ( [id://11117690]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -E 'say "|$_|" for split /-| /, "A B-C"'
    |A|
    |B|
    |C|
    
  2. or download this
    $ perl -E 'say "|$_|" for split /(-| )/, "A B-C"'
    |A|
    ...
    |B|
    |-|
    |C|
    
  3. or download this
    $ perl -E 'say "|$_|" for split /(-|)/, "A B-C"'
    |A|
    ...
    |B|
    |-|
    |C|
    
  4. or download this
    $ perl -E 'say "|$_|" for split / /, "A B-C"'
    |A|
    ...
    $ perl -E 'say "|$_|" for split " ", "A B-C"'
    |A|
    |B-C|
    
  5. or download this
    $ perl -E 'say "|$_|" for split //, "A B-C"'
    |A|
    ...
    |B|
    |-|
    |C|
    

Log In?
Username:
Password:

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

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

    No recent polls found