Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Extracting full digits from a range

by AnomalousMonk (Abbot)
on Aug 03, 2012 at 18:50 UTC ( #985310=note: print w/ replies, xml ) Need Help??


in reply to Extracting full digits from a range

One way:

>perl -wMstrict -le "my $s = 'xxx 293F:2945 yy ff:103 zz'; ;; my @ranges = map { eval join '..', map hex, split /:/ } $s =~ m{ [[:xdigit:]]+ : [[:xdigit:]]+ }xmsg ; ;; printf q{%x }, $_ for @ranges; " 293f 2940 2941 2942 2943 2944 2945 ff 100 101 102 103


Comment on Re: Extracting full digits from a range
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2015-07-03 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (49 votes), past polls