code formated according to PEP8, fixed missing re import, fixed erro in NinePatch __init__