added regex handling