# Writing a regex to find substring in kibana discover search bar

**URL:** <https://discuss.elastic.co/t/writing-a-regex-to-find-substring-in-kibana-discover-search-bar/228956>\
**Category:** Kibana\
**Created:** [April 21, 2020, 4:42am UTC](https://discuss.elastic.co/t/writing-a-regex-to-find-substring-in-kibana-discover-search-bar/228956 "2020-04-21T04:42:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurabh\_Singh1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saurabh_singh1/32/63178_2.png) [@Saurabh\_Singh1](https://discuss.elastic.co/u/Saurabh_Singh1)\
**Post date:** [April 21, 2020, 4:42am UTC](https://discuss.elastic.co/t/writing-a-regex-to-find-substring-in-kibana-discover-search-bar/228956/1 "2020-04-21T04:42:11Z")

</div>

Hi All,  
I was just playing with kibana discover page , I wanted to search a string using regex expression but somehow was not able to do. Need some help over this.  
I only want to use KQL not Lucene.

> I want to search any string containing substring as Saurabh Singh

For this i tried searching using regex as

message: _Saurabh Singh_

But i am getting output which has Singh and which has Saurabh seperately.

> Question : Can anybody help me with the regex for finding substring Saurabh Singh for field.

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [April 21, 2020, 5:53am UTC](https://discuss.elastic.co/t/writing-a-regex-to-find-substring-in-kibana-discover-search-bar/228956/2 "2020-04-21T05:53:30Z")

</div>

Hi

KQL currently doesn't support RegExp, you need to do it in Lucene in this case. Here is the issue you could follow about adding RegExp support to KQL:

> <https://github.com/elastic/kibana/issues/46855>
>
> I would love to have the ability to search for regex pattern in KQL.

Best,  
Matthias

---

<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:** [May 19, 2020, 5:53am UTC](https://discuss.elastic.co/t/writing-a-regex-to-find-substring-in-kibana-discover-search-bar/228956/3 "2020-05-19T05:53:31Z")

</div>

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