title: Elasticsearch Bool query with Regexp filter
body: <p>I have been trying to figure out the best way to use actual regex patterns within an Elasticsearch 5.4 query. After searching about the standard analyzer and tokenizing each string field, I started using the not analyzed field placed in my mappings (standard .raw property). I have tried two variants of the same query, neither has been successful.</p>
  
  <p>Query String filter:</p>
  
  <pre><code>GET /test-*/_search
  {
  "query": {
    "bool": {
      "must": [
        {
            "query_string":{
              "query": "URL.raw:/^(http|https)\\:\/\/.+(wp-content|wp-admin)/"
            }  
        }
      ]
    }
  },
  "sort": {
    "@timestamp": {
      "order": "desc"
    }
   }
  }
  </code></pre>
  
  <p>REGEXP FILTER:</p>
  
  <pre><code>GET /test-*/_search
  {
   "query": {
    "bool": {
      "must": [
        {
          "regexp": {
            "URL.raw":{
              "value": "/^(http|https)\\:\/\/.+(wp-content|wp-admin)/"
            }
          }
        }
      ]
    }
   },
   "sort": {
    "@timestamp": {
      "order": "desc"
    }
   }
  }
  </code></pre>
  
  <p>Both seem to yield no results or parse exceptions</p>
  
  <pre><code>{
    "error": {
      "root_cause": [
        {
          "type": "parse_exception",
          "reason": "parse_exception: Encountered \" \"^\" \"^ \"\" at line 1, column 8.\nWas expecting one of:\n    &lt;BAREOPER&gt; ...\n    \"(\" ...\n    \"*\" ...\n    &lt;QUOTED&gt; ...\n    &lt;TERM&gt; ...\n    &lt;PREFIXTERM&gt; ...\n    &lt;WILDTERM&gt; ...\n    &lt;REGEXPTERM&gt; ...\n    \"[\" ...\n    \"{\" ...\n    &lt;NUMBER&gt; ...\n    "
        },
  </code></pre>
  
  <p>Does lucene require special escaping or blacklisted chars? Any help or pointers would be much appreciated. Thanks!</p>