👻 Check our latest review to choose the best laptop for Machine Learning engineers and Deep learning tasks!
What is the best way to split a string like "HELLO there HOW are YOU"
by upper case words (in Python)?
So I"d end up with an array like such: results = ["HELLO there", "HOW are", "YOU"]
EDIT:
I have tried:
p = re.compile("[A-Z]{2,}")
print p.split(page_text)
It doesn"t seem to work, though.
👻 Read also: what is the best laptop for engineering students?
We hope this article has helped you to resolve the problem. Apart from Split string based on regex, check other array Python module-related topics.
Want to excel in Python? See our review of the best Python online courses 2023. If you are interested in Data Science, check also how to learn programming in R.
By the way, this material is also available in other languages:
- Italiano Split string based on regex
- Deutsch Split string based on regex
- Français Split string based on regex
- Español Split string based on regex
- Türk Split string based on regex
- Русский Split string based on regex
- Português Split string based on regex
- Polski Split string based on regex
- Nederlandse Split string based on regex
- 中文 Split string based on regex
- 한국어 Split string based on regex
- 日本語 Split string based on regex
- हिन्दी Split string based on regex
Warsaw | 2023-03-21
Simply put and clear. Thank you for sharing. Split string based on regex and other issues with code Python module was always my weak point 😁. I just hope that will not emerge anymore
New York | 2023-03-21
Maybe there are another answers? What Split string based on regex exactly means?. Will use it in my bachelor thesis
Warsaw | 2023-03-21
Thanks for explaining! I was stuck with Split string based on regex for some hours, finally got it done 🤗. Will get back tomorrow with feedback