viv:match

returns the first match of a regex pattern in a string

Synopsis

string
	viv:match
	(str, pattern, flag);
string    str;
string    pattern;
""|"i"    flag;

Description

Return the first string match of the regex pattern pattern in the string str.

Arguments

Returns

the first substring in str matching pattern.

Example

    <xsl:variable name="domain"
    select="viv:match(document/@url, '^.*\.com', 'i')" />