Regex for devision class number

Hello!
Can you please tell me what regular expression can be used to divide a multi-digit number/decimals into class numbers with non-breaking spaces

Only thing that worked looks very strange and it's not multipurposal.

E.g. for 9-digit number I used Find&Replace function

123456789

Find what: ([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])

Replace with: $1$2$3$ 4$5$6$ 7$8$9

This one could be used, but it absolutely useless with decimals 

Parents Reply Children
  • Thank you Phil for your answer.

    All your examples are relevant. (But if you can help me to divide integers without taking decimals it will be a great job too) 

    I had a table with a lot of so kind of numbers

    I wanted to divide into classes just integers, there were thousands, millions, billions, etc.

    For these tasks I used:

    Find what: ([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])

    Replace with: $1$2$3$ 4$5$6$ 7$8$9

    then 

    Find what: ([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])

    Replace with: $1$2 $3$4$5 $6$7$8

    etc. (every next step I I shortened the expression by one digit)

    But sometimes there were some decimals, and I had to do a lot of work just manually. So I'm trying to find more convenient way to work with this.

    Thank you