This means you are looking for a string that starts with a whitespace character and ends with a whitespace character with nothing else allowed in between. Is this what you were trying to say with your regex?
Also, this might be useful to you if you are trying to replace something that occurs more than once in your string. From the description:
To perform a global search and replace, include the g switch in the regular expression.