[Vienna-pm] pseudo-bitmask to ints
Thomas Klausner
domm at cpan.org
Tue Oct 23 06:31:43 PDT 2007
Hi!
Weil im IRC grad alle schmaestad sind:
Fuer folgendes Problem such ich eine kleine, praktische Loesung:
Gegeben ist ein String in der Form '00?1' der eine Bitmask darstellt
Ich brauche alle Ints, die dieser Batmask-Pseudo-Regex matchen, also in
diesem Fall 1 und 3
bzw, ich haatte gerne eine Funktion:
pseudobitmask2ints('00?1'); # (1,3)
pseudobitmask2ints('1??1'); # (9,11,15,16)
pseudobitmask2ints('0100'); # (4)
Mir reichen 4 bits.
Weiss da jemand was parktischen?
--
#!/usr/bin/perl http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
More information about the Vienna-pm
mailing list