# Using regex in kibana filters

**URL:** https://discuss.elastic.co/t/using-regex-in-kibana-filters/232704
**Category:** Kibana
**Created:** [May 14, 2020, 8:25pm UTC](https://discuss.elastic.co/t/using-regex-in-kibana-filters/232704 "2020-05-14T20:25:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sravan](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@sravan](https://discuss.elastic.co/u/sravan)
#### Post date: [May 14, 2020, 8:25pm UTC](https://discuss.elastic.co/t/using-regex-in-kibana-filters/232704/1 "2020-05-14T20:25:25Z")

</div>

I am trying to validate a field against a regular expression (regex). but its not validating.

I have a filed like presentation number ( which is text field) and I would like to filter this filed only that starts with 0-9 or start with +449 and +4470 using regex (^[0-9]|^+44(9|70)) .

I tried enclosing my regex in / and " but didnt work.

---

<div class="post-metadata">

### Author: ![cheiligers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheiligers/32/73114_2.png) [@cheiligers](https://discuss.elastic.co/u/cheiligers)
#### Post date: [June 4, 2020, 11:08pm UTC](https://discuss.elastic.co/t/using-regex-in-kibana-filters/232704/2 "2020-06-04T23:08:32Z")

</div>

@sravan welcome to the community!  
Are you using the Filter UI in the search bar, a filter in a visualization or a filter in a console query? It will be easier to help you if we know where you're getting stuck.

Elasticsearch does support [regular expression queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html) and will return the docs that match. Here's a link to the regular expression syntax docs: [https://www.elastic.co/guide/en/elasticsearch/reference/current/regexp-syntax.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/regexp-syntax.html).

If you're trying to use a regex in the Search Bar filters UI, you'll need to use the [query DSL option](https://www.elastic.co/guide/en/kibana/current/field-filter.html#filter-edit).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 2, 2020, 11:08pm UTC](https://discuss.elastic.co/t/using-regex-in-kibana-filters/232704/3 "2020-07-02T23:08:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
