# Regex for number with whitesapce

**URL:** <https://discuss.elastic.co/t/regex-for-number-with-whitesapce/155128>\
**Category:** Kibana\
**Created:** [November 2, 2018, 7:34am UTC](https://discuss.elastic.co/t/regex-for-number-with-whitesapce/155128 "2018-11-02T07:34:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nusrath](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Nusrath](https://discuss.elastic.co/u/Nusrath)\
**Post date:** [November 2, 2018, 7:34am UTC](https://discuss.elastic.co/t/regex-for-number-with-whitesapce/155128/1 "2018-11-02T07:34:25Z")

</div>

Hi There,

I have text content and want to search phone number or any number with white space in it.  
i tried with simple regex [0-9]{4} which matching something like below .

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/4/143eb3a64334619df5210f70506353c554b52366.png)

eg:- {text : " this is my phone number 1234 5678 90"}

i want to match entire string 1234 5678 90 along with space

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Dhananjaya\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dhananjaya_gupta/32/100048_2.png) [@Dhananjaya\_Gupta](https://discuss.elastic.co/u/Dhananjaya_Gupta)\
**Post date:** [November 5, 2018, 1:01pm UTC](https://discuss.elastic.co/t/regex-for-number-with-whitesapce/155128/2 "2018-11-05T13:01:16Z")

</div>

> [@Nusrath](#):
>
> {text : " this is my phone number 1234 5678 90"}

You can use  
text : ".\* [0-9]{4}  
for {text : "this is my phone number 1234 5678 9088"}

---

<div class="post-metadata">

**Author:** ![Nusrath](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Nusrath](https://discuss.elastic.co/u/Nusrath)\
**Post date:** [December 3, 2018, 8:19am UTC](https://discuss.elastic.co/t/regex-for-number-with-whitesapce/155128/3 "2018-12-03T08:19:01Z")

</div>

Thanks Dhananjaya,  
Is there any alternate solution. i have tried the same but it didn't work as expected.  
i have tried all possible regex pattern but no luck.

help will be appreciated.🙂

---

<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:** [December 31, 2018, 8:24am UTC](https://discuss.elastic.co/t/regex-for-number-with-whitesapce/155128/4 "2018-12-31T08:24:09Z")

</div>

Closed on December 31, 2018, 8:24am UTC

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