Docstring: reminder to escape appropriately in replace_regex (\\n for inserting \n) [ci skip]

This commit is contained in:
MischaPanch authored and Michael Panchenko committed 2025-08-15 13:43:57 +02:00
1 parent 4ce25cad6b
commit 4d9cd31e36
1 file changed
+2 -1
+2 -1
View File
@@ -179,7 +179,7 @@ class ReplaceRegexTool(Tool, ToolMarkerCanEdit):
the form "beginning.*?end-of-text-to-be-replaced".
Always try to use wildcards to avoid specifying the exact content of the code to be replaced,
especially if it spans several lines.
IMPORTANT: REMEMBER TO USE WILDCARDS WHEN APPROPRIATE! I WILL BE VERY UNHAPPY IF YOU WRITE LONG REGEXES WITHOUT USING WILDCARDS INSTEAD!
:param relative_path: the relative path to the file
@@ -187,6 +187,7 @@ class ReplaceRegexTool(Tool, ToolMarkerCanEdit):
Dot matches all characters, multi-line matching is enabled.
:param repl: the string to replace the matched content with, which may contain
backreferences like \1, \2, etc.
Make sure to escape special characters appropriately, e.g., use `\\n` for a literal `\n`.
:param allow_multiple_occurrences: if True, the regex may match multiple occurrences in the file
and all of them will be replaced.
If this is set to False and the regex matches multiple occurrences, an error will be returned