# How to search for regex with spaces?

**URL:** <https://discuss.elastic.co/t/how-to-search-for-regex-with-spaces/78930>\
**Category:** Kibana\
**Created:** [March 16, 2017, 8:19pm UTC](https://discuss.elastic.co/t/how-to-search-for-regex-with-spaces/78930 "2017-03-16T20:19:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZillaG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zillag/32/10505_2.png) [@ZillaG](https://discuss.elastic.co/u/ZillaG)\
**Post date:** [March 16, 2017, 8:19pm UTC](https://discuss.elastic.co/t/how-to-search-for-regex-with-spaces/78930/1 "2017-03-16T20:19:06Z")

</div>

I'm trying to do the following search on a field in my index called "msgbody"

`msgbody:/Task lge00[57].5 boundary/`

So I can see all the logs with the following text in the msgbody field.

```
Task lge005.5 boundary
Task lge007.5 boundary

```

I do see these logs but my regex doesn't find them. What am I missing?

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [March 17, 2017, 10:46am UTC](https://discuss.elastic.co/t/how-to-search-for-regex-with-spaces/78930/2 "2017-03-17T10:46:39Z")

</div>

msgbody might be an analyzed field, can you try searching on `msgbody.raw:` ?

---

<div class="post-metadata">

**Author:** ![ZillaG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zillag/32/10505_2.png) [@ZillaG](https://discuss.elastic.co/u/ZillaG)\
**Post date:** [March 17, 2017, 2:04pm UTC](https://discuss.elastic.co/t/how-to-search-for-regex-with-spaces/78930/3 "2017-03-17T14:04:49Z")

</div>

Thanks but that didn't work either. Here's a sample logs that I'm searching.

`Task lge005.5 boundary start: Remaining system memory before = 312641976`  
`Task lge005.5 boundary end: Remaining system memory after = 310773144`  
`Task lge007.5 boundary start: Remaining system memory before = 312641976`  
`Task lge007.5 boundary end: Remaining system memory after = 310773144`

I can search for

`msgbody:/lge00[57].5/`

but that shows up lines other than the ones I want above.

---

<div class="post-metadata">

**Author:** ![ZillaG](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zillag/32/10505_2.png) [@ZillaG](https://discuss.elastic.co/u/ZillaG)\
**Post date:** [March 28, 2017, 9:57pm UTC](https://discuss.elastic.co/t/how-to-search-for-regex-with-spaces/78930/4 "2017-03-28T21:57:36Z")

</div>

I'm surprised NO one has done a similar query before.

---

<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:** [April 25, 2017, 9:57pm UTC](https://discuss.elastic.co/t/how-to-search-for-regex-with-spaces/78930/5 "2017-04-25T21:57:52Z")

</div>

Closed on April 25, 2017, 9:57pm UTC

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