The following replacement
"index.html".replace('\.html$', '_fr.html');
returns "index.html", indicating that the first argument didn't match anything. However, if I remove the "$"
"index.html".replace('\.html', '_fr.html');
then the first argument matches and "index_fr.html" is returned.
Returning to the first example, can someone explain why ".html$" does not seem to match "index.html"?