.. _functx_escape-for-regex: ======================= functx:escape-for-regex ======================= Escapes regex special characters Description ~~~~~~~~~~~ The functx:escape-for-regex function escapes a string that you wish to be taken literally rather than treated like a regular expression. This is useful when, for example, you are calling the built-in fn:replace function and you want any periods or parentheses to be treated like literal characters rather than regex special characters. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg:string() - the string to escape Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - functx:escape-for-regex('5.55') - 5\.55 * - functx:escape-for-regex('[abc]') - \[abc\] See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`replace`.