Regex for number with whitesapce

(Syed Nusrath) #1

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 .

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.

(Dhananjaya Gupta) #2

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

(Syed Nusrath) #3

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.:slight_smile: