Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- clean_title = re.match(r'(.*)(.*)', title.lower())
- if clean_title:
- return clean_title.group(1).rstrip()
- >>'Alone in the Dark (The Cincinnati Series Book 2)'
- >>'alone in the dark'
- >>> clean_title = 'Alone in the Dark (The Cincinnati Series Book 2)'
- >>> clean_title.split('(', 1)[0].lower().rstrip()
- 'alone in the dark'
- >>> clean_title = 'Test'
- >>> clean_title.split('(', 1)[0].lower().rstrip()
- 'test'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement