import re


def splitn(s, n):
    """split string s into chunks no more than n characters long"""
    parts = re.split("(.{%d,%d})" % (n, n), s)
    map(parts.remove, [""] * parts.count(""))
    return parts