[[query-dsl-regexp-filter]] === Regexp Filter The `regexp` filter is similar to the <> query, except that it is cacheable and can speedup performance in case you are reusing this filter in your queries. See <> for details of the supported regular expression language. [source,js] -------------------------------------------------- { "filtered": { "query": { "match_all": {} }, "filter": { "regexp":{ "name.first" : "s.*y" } } } } -------------------------------------------------- You can also select the cache name and use the same regexp flags in the filter as in the query. *Note*: You have to enable caching explicitly in order to have the `regexp` filter cached. [source,js] -------------------------------------------------- { "filtered": { "query": { "match_all": {} }, "filter": { "regexp":{ "name.first" : { "value" : "s.*y", "flags" : "INTERSECTION|COMPLEMENT|EMPTY" }, "_name":"test", "_cache" : true, "_cache_key" : "key" } } } } --------------------------------------------------