diff --git a/salt/states/file.py b/salt/states/file.py index af3d58d988..731e891b77 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -3797,12 +3797,13 @@ def replace(name, A regular expression, to be matched using Python's :py:func:`~re.search`. - ..note:: + .. note:: + If you need to match a literal string that contains regex special characters, you may want to use salt's custom Jinja filter, ``escape_regex``. - ..code-block:: jinja + .. code-block:: jinja {{ 'http://example.com?foo=bar%20baz' | escape_regex }}