mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #14120 from garethgreenaway/8326
Attempt at making use of pattern in file.replace a bit more clear
This commit is contained in:
commit
1fded25a14
@ -1025,7 +1025,13 @@ def replace(path,
|
||||
This is a pure Python implementation that wraps Python's :py:func:`~re.sub`.
|
||||
|
||||
:param path: Filesystem path to the file to be edited
|
||||
:param pattern: The Python's regular expression search
|
||||
:param pattern: Python's regular expression search
|
||||
https://docs.python.org/2/library/re.html
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' file.replace /path/to/file pattern="bind-address\s*=" repl='bind-address:'
|
||||
|
||||
:param repl: The replacement text
|
||||
:param count: Maximum number of pattern occurrences to be replaced
|
||||
:param flags: A list of flags defined in the :ref:`re module documentation
|
||||
|
Loading…
Reference in New Issue
Block a user