Refactored sanitize_ to regex and local variables

fixes #149