Regular Expression String Length Python Function Definition