I have the following regular expression ' ((?:[\d][\s]?){5}[\d])
' and I'm testing it on link .
My problem is this: If I have this snippet ' teste 123456 teste
' it will only return me ' 123456
' which is correct. But if it is ' teste 12 345 6 teste
' it returns me ' 12 345 6
'.
I would like to know a way for it to return only the numbers without the spaces, if it has spaces.