Here is an example with XSLT 2.0, assuming the input is
Code:
<root>
<item>aspn-et123</item>
<item>1aspnet-12</item>
<item>98asp-net.1.0</item>
</root>
then the stylesheet
Code:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* , node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="item">
<xsl:copy>
<xsl:analyze-string select="replace(., '-', '')" regex="(\w{{3}})(\w{{5}})">
<xsl:matching-substring>
<xsl:value-of select="concat(regex-group(1), '-', regex-group(2))"/>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
outputs
Code:
<root>
<item>asp-net12</item>
<item>1as-pnet1</item>
<item>98a-spnet</item>
</root>