O
O
ornichola2018-04-25 23:50:03
Python
ornichola, 2018-04-25 23:50:03

How to split a string into substrings by capital letters?

There is a line like

str='Получать каждый деньНе получать оповещенияПолучать каждый часПолучать каждый деньПолучать еженедельно'

you need to get from it all substrings that start with capital letters:
['Получать каждый день', 'Не получать оповещения', 'Получать каждый час', ...]

How can this be done using regular expressions (or any other convenient way)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2018-04-26
@ornichola

e.g. [А-ЯЁ][^А-ЯЁ]*
https://ideone.com/WVjfmU

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question