diff --git a/Day-02/examples/03-regex-findall.py b/Day-02/examples/03-regex-findall.py index ec5cdd5c..251f0b89 100644 --- a/Day-02/examples/03-regex-findall.py +++ b/Day-02/examples/03-regex-findall.py @@ -3,8 +3,9 @@ text = "The quick brown fox" pattern = r"brown" -search = re.search(pattern, text) +search = re.findall(pattern, text) if search: - print("Pattern found:", search.group()) + print("Pattern found:", search) + print("Pattern count:", len(search)) else: print("Pattern not found")