.. _functx_index-of-match-first: =========================== 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. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg:string() - the string * - pattern:string() - the pattern to match Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **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') - () See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`functx_index-of-string-first`.