Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

by LanX (Saint)
on Oct 20, 2021 at 17:40 UTC ( [id://11137817]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
in thread Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)

Oh lord .... you are right!

All praise the /r flag! :)

And let's hope no one will ever stumble over the semipredicate whitespace you inject for splitting ;-)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^5: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
  • Download Code

Replies are listed 'Best First'.
Re^6: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
by Tux (Canon) on Oct 21, 2021 at 08:51 UTC

    Instead of using a space, I'd use U+002063. It would work just as the name suggests: INVISIBLE SEPARATOR

    my @list = split m/\x{2063}/ => s{(.)\K(?!\1)}{\x{2063}}gr;

    And I agree that once you have learned about \K and /r you will you that over and over and over again.


    Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-04-20 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found