import re


def parse_roll(roll='111111', d='6'):
  """Takes a string of numbers and returns array of integers. Roll is 0 to (d-1)"""
  pattern = re.compile('^[1-{}]+$'.format(d))
  if pattern.match(roll):
    return [(int(die) - 1) for die in list(roll)]
  else:
    return None