From 7e6c80fc2f365d96674019ada96e83b190424f62 Mon Sep 17 00:00:00 2001 From: Boris Muratov <8bee278@gmail.com> Date: Tue, 12 Jul 2022 13:53:42 +0300 Subject: Fix wrong var name in regex tag --- bot/resources/tags/regex.md | 4 ++-- 1 file 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** -- cgit v1.2.3