# Extracting docs with whitespaces between words in a field

**URL:** https://discuss.elastic.co/t/extracting-docs-with-whitespaces-between-words-in-a-field/220116
**Category:** Kibana
**Created:** [February 20, 2020, 7:54am UTC](https://discuss.elastic.co/t/extracting-docs-with-whitespaces-between-words-in-a-field/220116 "2020-02-20T07:54:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ramya\_Tanikanti](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Ramya\_Tanikanti](https://discuss.elastic.co/u/Ramya_Tanikanti)
#### Post date: [February 20, 2020, 7:54am UTC](https://discuss.elastic.co/t/extracting-docs-with-whitespaces-between-words-in-a-field/220116/1 "2020-02-20T07:54:30Z")

</div>

I have a field with zipcodes, some zipcodes are continuous without any whitespace some have whitespaces in between. Ex: "abc 123".

How can filter out or extract the docs with whitespace in between words using either the Search Query String or Painless Scripted Field?

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [February 20, 2020, 8:42am UTC](https://discuss.elastic.co/t/extracting-docs-with-whitespaces-between-words-in-a-field/220116/2 "2020-02-20T08:42:33Z")

</div>

Hi @Ramya_Tanikanti

you can do this with the search query string, but as KQL (the default option) does not support regex at the moment, you have to switch your query bar to Lucene first. To do this, click the "KQL" text on the right and turn off "Kibana Query Language". Then you can search for it like this: `zip:/.* .*/`

Make sure your field is keyword indexed for this to work (if you are using the default mapping there will be a `zip.keyword` field which contains the keyword indexed version of the `zip` field)

---

<div class="post-metadata">

### Author: ![Ramya\_Tanikanti](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Ramya\_Tanikanti](https://discuss.elastic.co/u/Ramya_Tanikanti)
#### Post date: [February 20, 2020, 8:53am UTC](https://discuss.elastic.co/t/extracting-docs-with-whitespaces-between-words-in-a-field/220116/3 "2020-02-20T08:53:29Z")

</div>

@flash1293 thank youu!! It worked 🙂

---

<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 19, 2020, 8:53am UTC](https://discuss.elastic.co/t/extracting-docs-with-whitespaces-between-words-in-a-field/220116/4 "2020-03-19T08:53:30Z")

</div>

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