My question is similar to this one, but with some modifications. First off I need to use python and regex. My string is: 'Four score and seven years ago.' and I want to split it by every 6th character, but in addition at the end if the characters do not divide by 6, I want to return blank spaces.
I want to be able to input: 'Four score and seven years ago.'
And ideally it should output: ['Four s', 'core a', 'nd sev', 'en yea', 'rs ago', '. ']
The closest I can get is this attempt, which ignores my period and does not give me the blank spaces
re.findall('.{%s}'%6,'Four score and seven years ago.') #split into strings
['Four s', 'core a', 'nd sev', 'en yea', 'rs ago']