Replace a string with variable number of spaces with replaceAll
===

I need to replace a string that could have on or more blank space in its content (at a fixed position) with another string. 

e.g: 

    [   string   ] 

must be replaced with: 

    anotherstring

(where there could be more or less or none blank spaces between " and string). And also the replacement must be case insenitive. Actually i'm using that expression: 

    myString.replaceAll("[(?i)string]", "anotherstring"); 

but it works only if there aren't spaces between brackets and string. 
How can i build an expression to consider also whitespaces? 