From a4c58cf10603e6649fc9fefc521b8e8362cce342 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 10 May 2023 21:17:45 -0700 Subject: [PATCH] aider: Updated regex pattern to recognize file paths that start with a dot. # Context: USER: the file path part of the regex is not recognizing files that start with a . like .bash_history ASSISTANT: I see. I'll update the regex pattern in `aider/coder.py` to recognize file paths that start with a dot (e.g., `.bash_history`). Here are the changes: ```python aider/coder.py <<<<<<< ORIGINAL r"^((?:[a-zA-Z]:\\|/)?(?:[\w\s.-]+[\\/])*\w+(\.[\w\s.-]+)*)" ======= r"^((?:[a-zA-Z]:\\|/)?(?:[\w\s.-]+[\\/])*(?:\w+|\.\w+)(\.[\w\s.-]+)*)" >>>>>>> UPDATED ``` This update should now correctly recognize file paths that start with a dot. --- aider/coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coder.py b/aider/coder.py index 20784e3fe..1c6fee881 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -347,7 +347,7 @@ class Coder: # Optional: Matches the start of a code block (e.g., ```python) and any following whitespace r"(^```\S*\s*)?" # Matches the file path - r"^((?:[a-zA-Z]:\\|/)?(?:[\w\s.-]+[\\/])*\w+(\.[\w\s.-]+)*)" + r"^((?:[a-zA-Z]:\\|/)?(?:[\w\s.-]+[\\/])*(?:\w+|\.\w+)(\.[\w\s.-]+)*)" # Optional: Matches the end of a code block (e.g., ```) and any following whitespace r"\s+(^```\S*\s*)?" # Matches the start of the ORIGINAL section and captures its content