Error with new version (1.2.14)

Yesterday I installed the latest version of the filter (1.2.14). Previously I've used 1.2.12d.

Since this update I get "errors" on the following line:

RewriteRule ^(/index.*?)(?<!.aspx)(\?.*)?$ $1.aspx$2 [I,L]

With the old version when the url was like /index the filter returned /index.aspx.
With the new version I get the following URL: /index.asp$2.

Offcourse this is not the intention.

In the log file I receive the following message while parsing this url:

GenerateReplacementString: Attention: Either we have a Substring index out of range, or the URL is using escaped chars ($2)
ApplyCaseConversion: after '/index.aspx$2'
ApplyRules: Result (length 13): /index.aspx$2
ApplyRules: Last if Match
ApplyRules: returning 1
DoRewrites: Rewrite Url to: '/index.aspx$2'

How can I resolve this problem without rewriting all the rules or go back to the previous version? I have a lot of this kind of rules.

Yes, the nerw version is a bit more strict about replacement string. You can work around it by re-writing your match pattern.

Instead of

^(/index.*?)(?<!.aspx)(\?.*)?$

Can you write:

^(/index.*?)(?<!.aspx)((\?.+)|())$

In this case, the second group ($2) captures the query string, starting with a question mark, or, if there is no question mark, then it captures nothing at all. I would say you might want to escape the dots - as they are wildcards. Also you might want to
separately capture the extension. So the result might be:

RewriteRule ^(/index)(\.[^?]+)(?<!\.aspx)((\?.+)|())$ $1.aspx$3

The first capture ($1) is "index" - but you could wildcard this to be something else. The second capture is the extension, including the leading dot. Example: .asp or .php. The third capture is the query string if any, including the leading question-mark.