Add missing docstring.
Check regular expressions from users for errors.