Subject: Re: [xsl] I desire this function: substring-before(string, regex charset) From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Sun, 13 Apr 2025 13:56:03 -0000 |
And, of course, the second function would just move the character class into the non-greedy search:
B replace('THEN THE CURTAIN','(^.*?[AEIOU]).*$','$1')
... returns "THE".
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" B version="3.0" B xmlns:xs="http://www.w3.org/2001/XMLSchema" B exclude-result-prefixes="#all">
B <xsl:template match="/" name="xsl:initial-template"> B B B <xsl:iterate select="(1 to count(analyze-string($input, '[AEIOU]')/*:match))"> B B B B B <xsl:param name="string" as="xs:string" select="$input"/> B B B B B <xsl:sequence select="$string"/> B B B B B <xsl:variable name="match" select="replace($string,'(^.*?[AEIOU]).*$','$1')"/> B B B B B <xsl:next-iteration> B B B B B B B <xsl:with-param name="string" select="substring-after($string, $match)"/> B B B B B </xsl:next-iteration> B B B </xsl:iterate> B </xsl:template>
THEN THE CURTAIN FELL N THE CURTAIN FELL B CURTAIN FELL RTAIN FELL IN FELL N FELL
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] I desire this function: s, G. Ken Holman g.ken. | Thread | Re: [xsl] I desire this function: s, Martin Honnen martin |
Re: [xsl] I desire this function: s, G. Ken Holman g.ken. | Date | Re: [xsl] I desire this function: s, Martin Honnen martin |
Month |