Fix variable provided to regex command to match what is used