Subject: Re: [xsl] Is there a way in XSLT/XPath to find the portion of a string that matches a pattern? From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 10 Mar 2025 22:04:02 -0000 |
Hi Folks,was matched? A? E? I? O? or U? It may be desirable to know that.
The following XPath determines if the string in $TEXT contains a vowel:
matches($TEXT, 'A|E|I|O|U')
If there is a match-the string in $TEXT contains a vowel-then which vowel
Another example: an XSLT program wants to know the series of digits in a
string; if the string is, "The person put 12 dollars into the jar" and the pattern is [0-9]+ then the matched portion is "12".
Problem Statement: if the value of $TEXT is a string and the value of $REGEX
is a pattern, then is there a way in XSLT/XPath to find the portion of the string that matches the pattern?
You do know XSLT 2's and later xsl:analyze-string and XPath 3.1 fn:analyze-string?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Is there a way in XSLT/XPath , Roger L Costello cos | Thread | Re: [xsl] Is there a way in XSLT/XP, Martin Honnen martin |
[xsl] Is there a way in XSLT/XPath , Roger L Costello cos | Date | Re: [xsl] Is there a way in XSLT/XP, Martin Honnen martin |
Month |