[Vienna-pm] pseudo-bitmask to ints

Marcel Grünauer gr at univie.ac.at
Tue Oct 23 09:41:53 PDT 2007


On Oct 23, 2007, at 3:31 PM, Thomas Klausner wrote:

> bzw, ich haatte gerne eine Funktion:
>
>    pseudobitmask2ints('00?1');   # (1,3)
>    pseudobitmask2ints('1??1');   # (9,11,15,16)

16? Wie? Eher 9, 11, 13, 15.

>    pseudobitmask2ints('0100');   # (4)

Also alles in allem, mit Rolands elegantem glob()-Code:

perl -le'print unpack("N", pack("B32", substr("0" x 32 . $_, -32)))  
for glob("1{0,1}{0,1}1")'
9
11
13
15

Marcel



More information about the Vienna-pm mailing list