Skip to content

Instantly share code, notes, and snippets.

@mylons
Created October 14, 2011 17:42
Show Gist options
  • Save mylons/1287777 to your computer and use it in GitHub Desktop.
Save mylons/1287777 to your computer and use it in GitHub Desktop.
lol @ perl
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