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

Re: How can I reduce this with a REGEX?

by hdb (Prior)
on Mar 14, 2014 at 17:48 UTC ( #1078370=note: print w/ replies, xml ) Need Help??

in reply to How can I reduce this with a REGEX?

Also using a hash but in a different way:

use strict; use warnings; my @strings = qw( 12-12 12-12-12 12-13-12-13 12-12-13-13 12-13-13-14 ) +; for (@strings) { my %hash; s/(\-?)(\d\d)/ $hash{$2}++ ? '' : $1.$2 /ge; print "$_\n"; }

Comment on Re: How can I reduce this with a REGEX?
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2015-11-25 09:11 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (672 votes), past polls