# Performing a regex search in Kibana dev tools

**URL:** <https://discuss.elastic.co/t/performing-a-regex-search-in-kibana-dev-tools/119273>\
**Category:** Kibana\
**Created:** [February 9, 2018, 4:31pm UTC](https://discuss.elastic.co/t/performing-a-regex-search-in-kibana-dev-tools/119273 "2018-02-09T16:31:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghouston10](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@ghouston10](https://discuss.elastic.co/u/ghouston10)\
**Post date:** [February 9, 2018, 4:31pm UTC](https://discuss.elastic.co/t/performing-a-regex-search-in-kibana-dev-tools/119273/1 "2018-02-09T16:31:23Z")

</div>

Hi,

I am trying to perform a regex search in dev tools within kibana.

Current query:

GET test/\_search  
{  
"query": {  
"regexp":{  
"BATAPSN": "._BDT[0-9]{4}._"  
}  
}  
}

I want the query to identify BDT, followed by 4 numbers, e.g. BDT1234 in the BATAPSN field.

The query is returning results such as BDT12345 which is not desired.

How can I fix this issue.

Thanks

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [February 9, 2018, 7:38pm UTC](https://discuss.elastic.co/t/performing-a-regex-search-in-kibana-dev-tools/119273/2 "2018-02-09T19:38:40Z")

</div>

Hi Gearoid,

It looks like you have periods at the beginning and ending of your regex: `.BDT[0-9]{4}.` -- is this intentional? If so, what is the role they're supposed to play? I believe the ending period is what's causing this regex to match `BDT12345`, because it indicates that any character is acceptable following the `[0-9]{4}` match. The `1234` section matches that part of the pattern and then the ending `5` is matched by the period. Does this help?

Thanks,  
CJ

---

<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:** [March 9, 2018, 7:39pm UTC](https://discuss.elastic.co/t/performing-a-regex-search-in-kibana-dev-tools/119273/3 "2018-03-09T19:39:08Z")

</div>

Closed on March 9, 2018, 7:39pm UTC

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