Fix: URI with first $ escaped won't be recognized

Old code did only check whether there's a `$` in `$escapedUri` and whether it is escaped.