Update regex to handle escaping of dollar signs