[[:space:]] matches any whitespace character - including the linebreaks.
So that regex matches
The start of the string
The end of the string
Any number of spaces, linebreaks or other whitespace at the start of the string
Any number of spaces, linebreaks or other whitespace at the end of the string
I'm unclear exactly what you want to do. If you want to change turn two consecutive spaces into one, it's easiest to do:
replace ( x, ' ', ' ' )
That's REPLACE with two spaces, followed by one space.
Some example strings showing us what you want to change and how would help.