I have string for example
subject = '=?UTF-8?Q?=C5=A0irvint=C5=B3_PSPC_ir_TENESYS_3CX_RESTful_API?='
I want to split it by '?='
and it working ok if there is only 1 '?='
my string, but when I have more than 1 I'm getting problems.
I know that I can split my string skipping that ?= that is going after "=?UTF-8?Q"
this is my code
for split_begin in subject.split('=?'):
for split_end in split_begin[:2].split('?='):
if 'UTF-8' in split_end:
special_word = '=?' + split_end + '?='
word_list.append(special_word)
UPDATE.
when string is '=?UTF-8?Q?=C5=A0irvint=C5=B3_PSPC_ir_TENESYS_3CX_RESTful_API?='
split end = 'UTF-8?Q'
this is bad output.
when string is `subject = '=?UTF-8?Q?D=C4=97l_greito_va=C5=BEiavimo?='
split end = 'UTF-8?Q?D=C4=97l_greito_va=C5=BEiavimo'
this is good output.
different in the string that second string has only 1 ?=
in it