.. _functx_substring-before-match: ============================= functx:substring-before-match ============================= O trecho antes do primeiro texto que casa com uma expressão regular Descrição ~~~~~~~~~ A função functx:substring-before-match devolve a parte de $arg que vem antes do primeiro trecho que casa com $regex. Se $arg não casar com $regex, devolve $arg inteiro. Se $arg for a sequência vazia, devolve uma string vazia. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parâmetros** - **Descrição** * - arg:string() - a string de onde tirar o trecho * - regex:string() - a expressão regular Exemplos ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Resultado** * - functx:substring-before-match('abc-def-ghi', '[dg]') - abc- * - functx:substring-before-match('abc-def-ghi', '[dg]')functx:substring-before-match('abcd-abcd', 'bc?') - a * - functx:substring-before-match('abcd-abcd', 'x') - abcd-abcd Veja também ~~~~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`substring-before`. * :ref:`functx_substring-after-last-match`.