aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar LeandroVandari <[email protected]>2025-03-17 22:01:35 -0300
committerGravatar LeandroVandari <[email protected]>2025-03-17 22:01:35 -0300
commita886997d807837621733efb7ac634fa1a4ce606b (patch)
tree6eb3e51e5332dfa2f21d597eba43ebb58b6c599d
parentFixed off-by-one error, as the end index can be equal to the length of the zen (diff)
Added support for negative signs and replaced re.search by re.match
-rw-r--r--bot/exts/utils/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/utils/utils.py b/bot/exts/utils/utils.py
index 817d159b2..29db374b4 100644
--- a/bot/exts/utils/utils.py
+++ b/bot/exts/utils/utils.py
@@ -111,7 +111,7 @@ class Utils(Cog):
zen_lines = ZEN_OF_PYTHON.splitlines()
# Prioritize checking for an index or slice
- match = re.search(r"^(\d+)(:\d+)?", search_value.split(" ")[0])
+ match = re.match(r"(-?\d+)(:-?\d+)?", search_value.split(" ")[0])
if match:
upper_bound = len(zen_lines) - 1
lower_bound = -1 * len(zen_lines)