functx:index-of-match-first
The first position of a matching substring
Description
The functx:index-of-match-first function returns an integer representing the first position of a substring that matches $pattern within $arg. If $arg does not match $pattern, the empty sequence is returned.
Parameters |
Description |
---|---|
arg:string() |
the string |
pattern:string() |
the pattern to match |
Examples
XPath |
Results |
---|---|
functx:index-of-match-first(‘abcdabcdabcd’,’abc’) |
1 |
functx:index-of-match-first(‘abcdabcdabcd’,’bcd’) |
2 |
functx:index-of-match-first(‘a1234’,’d’) |
2 |
functx:index-of-match-first(‘abc abc’,’s’) |
4 |
functx:index-of-match-first(‘abc abc’,’z’) |
() |