title: Delete multiple indices in one Elasticsearch HTTP request (cURL)
body: <p>I was using this <code>curl</code> command line to clean my indices:</p>
  
  <pre><code>curl -XDELETE http://example.com/my_index-*
  </code></pre>
  
  <p>But, now, I want to delete <code>my_index-.*[.][0-3][0-9]</code>:</p>
  
  <ul>
  <li>to delete only <code>my_index-YYYY.MM.dd</code></li>
  <li>to keep <code>my_index-YYYY.MM.dd-*</code></li>
  </ul>
  
  <hr>
  
  <p>The relevant Elasticsearch documentation I have found:</p>
  
  <ul>
  <li><p><a href="https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-delete-index.html" rel="noreferrer">Delete index API</a> does say nothing on regex.</p></li>
  <li><p><a href="https://www.elastic.co/guide/en/elasticsearch/reference/5.4/multi-index.html" rel="noreferrer">Multiple indices</a> says:</p>
  
  <blockquote>
    <p>It also support wildcards, for example: <code>test*</code> or <code>*test</code> or <code>te*t</code> or <code>*test*</code>, and the ability to "add" (<code>+</code>) and "remove" (<code>-</code>), for example: <code>+test*,-test3</code>.</p>
  </blockquote></li>
  <li><p><a href="https://www.elastic.co/guide/en/elasticsearch/reference/5.4/date-math-index-names.html" rel="noreferrer">Date math support in index names</a> says:</p>
  
  <blockquote>
    <p>Almost all APIs that have an <code>index</code> parameter, support date math in the <code>index</code> parameter value.<br>
    [...]<br>
    <code>date_format</code> is the optional format in which the computed date should be rendered. Defaults to <code>YYYY.MM.dd</code>.</p>
  </blockquote></li>
  </ul>
  
  <hr>
  
  <p>My Questions:</p>
  
  <ul>
  <li><strong>Is it possible to send a <code>DELETE</code> request method to Elasticsearch HTTP server to delete indices only formatted <code>my_index-YYYY.MM.dd</code>?</strong></li>
  <li><strong>Or the inverse, to delete all <code>my_index-*</code> but keeping <code>my_index-*-*</code>?</strong></li>
  </ul>
  
  <hr>
  
  <p>For example, regex can sometimes be provided within the <code>POST</code> data:</p>
  
  <pre><code>curl -XPOST http://example.com/my_index-2017.07.14/_search?pretty' -H 'Content-Type: application/json' -d'
  {
      "suggest": {
          "song-suggest" : {
              "regex" : "n[ever|i]r",
              "completion" : {
                  "field" : "suggest"
              }
          }
      }
  }'
  </code></pre>