Automate the Boring Stuff Chapter 7: Regular Expressions - phone number and email extractor only extracting phone numbers
I made sure the code was copied correctly
- nope. You should replace {2-4}
with {2,4}
to look for 2 to 4 characters according to both RegEx syntax and chapter 7 text.
You may consider to use https://regex101.com/ to try your regular expressions online and see regex full explanation.