aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Boris Muratov <[email protected]>2022-07-12 13:53:42 +0300
committerGravatar GitHub <[email protected]>2022-07-12 13:53:42 +0300
commit7e6c80fc2f365d96674019ada96e83b190424f62 (patch)
tree94f757e41211b79e8c6b7ae4c21f962e7e4a418d
parentAdd Aliases for Tags Support (#2213) (diff)
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**