Cleaning Text with Regular Expressions
- 23 Dec 2022
- 1 Minute to read
- Print
- DarkLight
Cleaning Text with Regular Expressions
- Updated on 23 Dec 2022
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
These exercises focus on manipulating text data through regular expressions.
Exercises
- Use the RegEx tester at regex101.com to find the following regular expressions:
- All whitespace at the beginning and end.
- Any periods.
- Any capital letters after a space.
- Clean the cleanse.csv file by doing the following:
- Remove all whitespace at the ends
- Replace any periods with underscores
- Remove any whitespace before capital letters
- Create 3 new columns that denote if that condition is satified for a given record.
Hints
- Read through Cleanse.
Was this article helpful?