More tests.
diff --git a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
index 71b3e1d..d2cdec4 100644
--- a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
+++ b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
@@ -303,9 +303,15 @@
      */
     @Test
     public void testReplaceComplexEscaping() throws IOException {
+        doReplace("${1}", "$${${a}}", false);
+        doReplace("${11}", "$${${aa}}", false);
+        doReplace("${111}", "$${${aaa}}", false);
         doReplace("${quick brown fox}", "$${${animal}}", false);
         doReplace("The ${quick brown fox} jumps over the lazy dog.", "The $${${animal}} jumps over the ${target}.",
             true);
+        doReplace("${${a}}", "$${$${a}}", false);
+        doReplace("${${aa}}", "$${$${aa}}", false);
+        doReplace("${${aaa}}", "$${$${aaa}}", false);
         doReplace("${${animal}}", "$${$${animal}}", false);
         doReplace(".${${animal}}", ".$${$${animal}}", false);
         doReplace("${${animal}}.", "$${$${animal}}.", false);