Enhanced --auto-cmd to take a REGEX instead of a STRING.