### Description

It is impossible to create a follower index with a `$` character in its name (please note, it is possible to create a regular index with `$` in its name).

This could be reproduced by rest request:
```
PUT /my-index/_ccr/follow
{
    "remote_cluster": "my-remote-cluster",
    "leader_index": "my-index$follower"
}
```

or `CcrIntegTestCase`:

```
    public void testFollowIndex() throws Exception {
        assertAcked(leaderClient().admin().indices().prepareCreate("my$index"));
        setupRemoteCluster();
        final PutFollowAction.Request followRequest = putFollow("my$index", "my$index");
        followerClient().execute(PutFollowAction.INSTANCE, followRequest).get();
    }
```

This is happening as during initial follow phase we restore the leader cluster from the remote using a snapshot restore.
Corresponding request is created with index name added to `RestoreSnapshotRequest#renamePattern` (regexp) without escaping `$`.

x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/IndexFollowingIT.java
);
            } catch (Exception e) {
                throw new AssertionError("error while searching", e);
            }
        });
        assertThat(hasFollowIndexBeenClosedChecker.getAsBoolean(), is(false));
    }
    public void testUpdateAnalysisLeaderIndexSettings() throws Exception {
        final String leaderIndexSettings = getIndexSettings(1, 0);
        assertAcked(leaderClient().admin().indices().prepareCreate("leader").setSource(leaderIndexSettings, XContentType.JSON));
        ensureLeaderYellow("leader");
        final PutFollowAction.Request followRequest = putFollow("leader", "follower");
        followerClient().execute(PutFollowAction.INSTANCE, followRequest).get();
        BooleanSupplier hasFollowIndexBeenClosedChecker = hasFollowIndexBeenClosed("follower");
        final long firstBatchNumDocs = randomIntBetween(2, 64);
        for (long i = 0; i < firstBatchNumDocs; i++) {
            leaderClient().prepareIndex("leader").setSource("{}", XContentType.JSON).get();
        }
        assertBusy(
            () -> assertThat(followerClient().prepareSearch("follower").get().getHits().getTotalHits().value, equalTo(firstBatchNumDocs))
        );
        assertThat(getFollowTaskSettingsVersion("follower"), equalTo(1L));
        assertThat(getFollowTaskMappingVersion("follower"), equalTo(1L));
        CloseIndexRequest closeIndexRequest = new CloseIndexRequest("leader");
        assertAcked(leaderClient().admin().indices().close(closeIndexRequest).actionGet());
        UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest("leader");
        updateSettingsRequest.settings(
            Settings.builder()
                .put("index.analysis.analyzer.my_analyzer.type", "custom")
                .put("index.analysis.analyzer.my_analyzer.tokenizer", "keyword")