Handle isolated and double dollar sign properly