Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- tester = "DIALER_STANDARD_AP1_2016-11-15.csv"
- #tester = tester[:-14]
- deck_name = re.search('_A(.+?)_2', tester).group(0)
- deck_name = deck_name[1:] # remove the _ start
- deck_name = deck_name[:-2] # remove the _2 end
- deck_name = deck_name[:2] + "L" + deck_name[2:] # insert a string into the middle of another string
- print deck_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement