Created
October 14, 2011 17:42
-
-
Save mylons/1287777 to your computer and use it in GitHub Desktop.
lol @ perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
cigar = "32M1I89M1D7M1D37M1D16M1I71M1I12M1I18M1I19M3S" | |
matches = re.findall("([0-9]+)([A-Z]+)", cigar) | |
for length, operation in matches: | |
print operation, length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment