# Regular expression doesnt work in Kibana Search panel

**URL:** <https://discuss.elastic.co/t/regular-expression-doesnt-work-in-kibana-search-panel/1656>\
**Category:** Kibana\
**Created:** [June 1, 2015, 4:42pm UTC](https://discuss.elastic.co/t/regular-expression-doesnt-work-in-kibana-search-panel/1656 "2015-06-01T16:42:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [June 1, 2015, 4:42pm UTC](https://discuss.elastic.co/t/regular-expression-doesnt-work-in-kibana-search-panel/1656/1 "2015-06-01T16:42:42Z")

</div>

Hi All

As we have a search panel in Kibana Discovery tab, i want to search Phone Number

In my current dataset I have certain Phone Number which is not numeric, i want to sort out which are non-numeric

For this I am using this regular expression in search panel

PHONE : [0-9]\ this is for numeric  
PHONE : ^[0-9] this is for non-numeric

Please let me know if we can run regular expressions in Kibana Search panel

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 1, 2015, 4:49pm UTC](https://discuss.elastic.co/t/regular-expression-doesnt-work-in-kibana-search-panel/1656/2 "2015-06-01T16:49:34Z")

</div>

[As documented](https://www.elastic.co/guide/en/elasticsearch/reference/1.x/query-dsl-query-string-query.html#_regular_expressions), regular expressions should be surrounded by forward slashes. Also, your regular expressions don't make sense. The first one isn't a valid regexp (it can't end with a backslash) and the first one matches field values that begin with a literal ^ followed but a digit. If you want to check if a field value only contains digits you should be able to use `phone:/^\d+$/` and you to match everything else you can say either `NOT phone:/^\d+$/` or `phone:/\D/`.

---

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [June 1, 2015, 5:09pm UTC](https://discuss.elastic.co/t/regular-expression-doesnt-work-in-kibana-search-panel/1656/3 "2015-06-01T17:09:49Z")

</div>

Hi

It was my mistake, i was using this

PHONE : /[0-9]/ this is for numeric  
PHONE : /^[0-9]/ this is for non-numeric

I do not see anything for "d" in [Regular Expression](https://www.elastic.co/guide/en/elasticsearch/reference/1.x/query-dsl-regexp-query.html#regexp-syntax). What does "d" signifies for

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 1, 2015, 5:23pm UTC](https://discuss.elastic.co/t/regular-expression-doesnt-work-in-kibana-search-panel/1656/4 "2015-06-01T17:23:27Z")

</div>

`\d` means digit in most regular expression variants. Maybe not Lucene's though—replace with `[0-9]` in that case.

Again, I can't make specific comments about your expressions since I don't know what you want to match, but `^[0-9]` still doesn't make sense. If you want to match non-digits you need `[^0-9]`.

---

<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 6, 2017, 2:18pm UTC](https://discuss.elastic.co/t/regular-expression-doesnt-work-in-kibana-search-panel/1656/5 "2017-07-06T14:18:46Z")

</div>


