[Home] [By Thread] [By Date] [Recent Entries]
Joe Fawcett wrote:
The trouble with these is that they don't cope with expressions such as "UKBank" or "BankOfUSA". I'm trying to come up with a neat expression that does. The trouble is that I put the space on the wrong position. I was thinking of the double capitals and it is of course easily fixed, but I didn't know the requirements well enough. For instance: "AStringToPutAFewSpacesIn" is going to give you trouble anyway: <xsl:value-of select="replace('BankOfUSA', '(.)([A-Z]+)', '$1 $2')" /> or, perhaps prettier: <xsl:value-of select="normalize-space(replace('BankOfUSA', '[A-Z]+', ' $0'))" /> both will output: "Bank Of USA" Cheers, -- Abel Braaksma
|

Cart



