I'm not sure how you would expect a regular expression to help with this.
In XSLT 2.0 you can write
<xsl:variable name="$spaces" select="
string-join(for $i in 1 to 1000 return ' ', '')"/>
In 1.0 you can do
<xsl:template name="replicate">
<xsl:param name="s"/>
<xsl:param name="i"/>
<xsl:for-each select="(//node())[position() <= $i]">
<xsl:value-of select="$s"/>
</xsl:for-each>
</xsl:template>
<xsl:variable name="spaces">
<xsl:call-template name="replicate">
<xsl:with-param name="s" select="' '"/>
<xsl:with-param name="i" select="50"/>
</xsl:call-template>
</xsl:variable>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference