I am a very young developer and I cannot find the solution.

I have an entry in which the user enters a number which should be separated like this XX XXX XXXX

By doing this I separate the numbers like that XXX XXX XXX
but that's not what i want

`result = '123456789'.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ");`

I would probably need something like this, but I'm blocking it

`.replace(/"(..)(...)(....)","$1 ""$2 ""$3 "/g)`

If you could give me any help that would be very appreciated.