Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- string_input = input()
- occurrences = input()
- occurrences_count = []
- pattern = f"\\b{occurrences}\\b"
- matches = re.findall(pattern, string_input, re.IGNORECASE)
- if matches:
- occurrences_count.extend(matches)
- print(len(occurrences_count))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement