switch to regex-based approach