티스토리 뷰

공부

[Python] regexp split

seunggabi 승가비 2020. 6. 26. 01:00
l = re.compile("(?<!^)\s+(?=[A-Z])(?!.\s)").split(s)

https://stackoverflow.com/questions/13209288/python-split-string-based-on-regex

 

Python split string based on regex

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: ...

stackoverflow.com

 

'공부' 카테고리의 다른 글

[Python] Making a job fail in jenkins  (0) 2020.06.26
[Sh] sleep  (0) 2020.06.26
[Python] regexp split  (1) 2020.06.26
[Python] contains HashSet  (0) 2020.06.26
[IntelliJ] How to Change Read-Only Status of Files in intellij  (0) 2020.06.26
[Kafka] basic  (0) 2020.06.18
댓글
댓글쓰기 폼