Regex for Data Cleaning: Extract IDs and Phones in Python
Seven made-up messy notes: two regex patterns pull out 5 order ids and 5 phone numbers, and miss 1.
Video #151 ยท Python for data
Steps in the video
Files
- clean.py (22 lines)
- notes.py (10 lines)
- run.py (29 lines)
Tested with
Python 3.12.15
What this does not show
Seven made-up notes and patterns for only the formats shown, so the run says nothing about real, larger or multilingual text.
Sources
Learning IT by Example.