I want to split below string to get each statement separately using regular expression.
Input string:
str1 = "1. Write down what you eat for one week and you will lose weight. 2. Add 10 percent to the amount of daily calories you think you're eating. 3. Get an online weight loss buddy to lose more weight. 4. Get a mantra. 5. Eat three fewer bites of your meal, one less treat a day, or one less glass of orange juice. More items"
My attempt:
re.split(r'[A-z]\.',str1)
Output:
['1. Write down what you eat for one week and you will lose weigh', "
2. Add 10 percent to the amount of daily calories you think you're eatin",
' 3. Get an online weight loss buddy to lose more weigh', '
4. Get a mantr', ' 5. Eat three fewer bites of your meal, one less treat a day, or one less glass of orange juic', ' More items']
In output i am missing last letter of every statement. I want the output as below:
['1. Write down what you eat for one week and you will lose weight', " 2. Add 10 percent to the amount of daily calories you think you're eating", ' 3. Get an online weight loss buddy to lose more weight', ' 4. Get a mantra', ' 5. Eat three fewer bites of your meal, one less treat a day, or one less glass of orange juice', ' More items']