Hi,
I have this expression
Please help
Here's the full code:
I have this expression
text_list = re.split('\n\n\n', text)I read already the Slipt() method that expression confuses me. the output of it it's a list []:
Output:['Good Morning\n\nthis is testing test.', 'Vriendelike groete/ Kind regards\n\nJoe Fraser\n\nDirect tel: 001 555 3651 | Email:\[email protected]', '',
'\nFrom: [email protected]\n\nSent: 28 March 2019 11:00 AM\nTo: King Brand;[email protected];\nSubject: Notification of Creation', '\n\nDear Boss',
'How are you\ntoday\n\nYour number\n\nWhen you contacted us: 2019-03-2810:15 AM\u2009\n\nSrequesting\n\nBranch Agency: Meme\u2009\n\nBranch Agency Code:
0329271\u2009\n\nThank you for contacting us\n\'Kind regards\n\nAgriculture Contact Centre \u2009', 'E-Mail: [email protected]\u2009']
My confusion is that '\n\n\n'Please help
Here's the full code:
import re from bs4 import BeautifulSoup html = ''' Good Morning We need your input please. Vriendelike groete/ Kind regards Badu Thusong Direct tel: 021 974 7313 | Email: [email protected] From: [email protected]] Sent: 28 March 2019 11:00 AM To: King Budo;[email protected]; Subject: Notification of Creation Dear Boss How are you today Your number Branch Agency: Meme Branch Agency Code: 0329271 Thank you for contacting us Kind regards Agriculture Contact Centre E-Mail: [email protected] ''' # print(html) text_list = re.split('\n\n\n', html) print(text_list)Output:
Output:['\nGood Morning\n\nWe need your input please.', 'Vriendelike groete/ Kind regards\n\nBadu Thusong\n\nDirect tel: 021 974 7313 | Email:\[email protected]', '', '\nFrom: [email protected]]\n\nSent: 28 March 2019 11:00 AM\nTo: King Budo;[email protected];\nSubject: Notification of Creation', '\n\nDear Boss', 'How are you\n\ntoday\n\nYour number\n\nBranch Agency: Meme\n\nBranch Agency Code: 0329271\n\nThank you for contacting us', 'Kind regards\n\nAgriculture Contact Centre', 'E-Mail: [email protected]\n']
I'm really not sure what does those new lines do, more especially that it's three of them in the expression.