Description
The functx:substring-after-match function returns the part of $arg that appears after the first match of $regex . If $arg does not match $regex , the entire $arg is returned. If $arg is the empty sequence, the empty sequence is returned.
Arguments and Return TypeName | Type | Description |
$arg |
xs:string? |
the string to substring |
$regex |
xs:string |
the regular expression |
return value |
xs:string? |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:substring-after-match" as="xs:string?"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg" as="xs:string?"/>
<xsl:param name="regex" as="xs:string"/>
<xsl:sequence select="
replace($arg,concat('^.*?',$regex),'')
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:substring-after-match(
'abc-def-ghi', '[ce]') |
-def-ghi |
functx:substring-after-match(
'abcd-abcd', 'ab?') |
bcd-abcd |
functx:substring-after-match(
'abcd-abcd', 'x') |
abcd-abcd |
See AlsoHistory |
Recommended Reading:
|