Lea, sounds like you have your solution.
Regarding end-of-line assertions, it depends on how you want to match. A pattern like ^/cart will match a url with a query string, eg,
..while a pattern like ^/cart$ will not match that URL, because it asserts that nothing can follow the t.
In the examples you cite, I suppose that I wasn't trying to explicitly make a point of how to properly use $. I was covering some other point, probably.
I don't understand why your sitemap.xml rule would fail to rewrite if it included a $. If I had to guess, I'd say that perhaps to crawlers are requesting sitemap.xml?something - in other words, there's a query string appended. The crawlers might
do this to contrive a unique URL; appending a timestamp on a dummy-named query parameter is one common way to do this.
To illustrate, requesting "sitemap.xml" will get the sitemap.xml resource, but it might be a cached version, and could be out of date. A request for "sitemap.xml?_=393893" is going to be a unique request, and it cannot be fulfilled from any cache,
therefore it is more likely to be generated "fresh".
I don't know if this is what is happening for you, just a guess. One way to find out is to check the IIRF log. Another source of insight might be the IIS log that will show the incoming requests for sitemap.xml .
But if it already works for you, maybe there is nothing further you need to do. A question you don't need the answer to.