aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-07-12 14:57:05 +0400
committerGravatar GitHub <[email protected]>2022-07-12 14:57:05 +0400
commite9c7d6ef77fd8b99bb3179945a1994b447cec32b (patch)
tree94f757e41211b79e8c6b7ae4c21f962e7e4a418d
parentAdd Aliases for Tags Support (#2213) (diff)
parentFix wrong var name in regex tag (diff)
Merge pull request #2214 from python-discord/mbaruh/regex-tag-fix
Fix wrong var name in regex tag
-rw-r--r--bot/resources/tags/regex.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/resources/tags/regex.md b/bot/resources/tags/regex.md
index 35fee45a9..ae7960b37 100644
--- a/bot/resources/tags/regex.md
+++ b/bot/resources/tags/regex.md
@@ -5,9 +5,9 @@ Regular expressions (regex) are a tool for finding patterns in strings. The stan
We can use regex to pull out all the numbers in a sentence:
```py
>>> import re
->>> x = "On Oct 18 1963 a cat was launched aboard rocket #47"
+>>> text = "On Oct 18 1963 a cat was launched aboard rocket #47"
>>> regex_pattern = r"[0-9]{1,3}" # Matches 1-3 digits
->>> re.findall(regex_pattern, foo)
+>>> re.findall(regex_pattern, text)
['18', '196', '3', '47'] # Notice the year is cut off
```
**See Also**