Perlmonks CB60

Rendered at 2024-05-03 14:29:03 UTC

to bottom

ambrus    2024-05-03 14:05:29 UTC
ugh, I have to escape the hyphen in the y
ambrus    2024-05-03 14:04:57 UTC
Is there a saner way to do this than some nonsense like @u = split /&/,$i; @o = ("")x5; @o[sort((1,3,2,0,4)[keys@u])] = @u; $o[2]=~y/ .-_//c and die; return @o[1,3];
ambrus    2024-05-03 14:02:36 UTC
A to E represent arbitrary strings without ampersands. I must extract B and D (I can throw away the others), and also verify that there are no more than four ampersands, and verify that C is made from only a small set of characters.
ambrus    2024-05-03 14:01:24 UTC
I have a string that I have to split on ampersands to at most five parts, depending on the number of ampersands it'll be one of these forms: B, B&D, B&C&D, A&B&C&D, A&B&C&D&E, where

to top


Preferred Domain for Perlmonks:
Show messages with the
Timezone:
Format:    
Users to ignore:


Version 0.0304 (Test)
Coding By: demerphq
Hosted by: Corion