[Tutor] Remove some known text around text I need to keep

Robert Alexander gogonegro at gmail.com
Thu Jan 30 02:06:20 EST 2020


Dear tutors,
thanks a lot for the input. It taught me a few new tricks :)

The OP just forgot to eliminate the closing square bracket in his example.
May he suffer consequences for this oversight! and yes we usually tend to
use parenthesis, whatever their shape, always in pairs, also in this
country ;)

A good day to all of you.

Robert

On 30 January 2020 at 01:35:41, David L Neil via Tutor (tutor at python.org)
wrote:

On 30/01/20 12:30 PM, Alan Gauld via Tutor wrote:
> On 29/01/2020 22:05, DL Neil via Tutor wrote:
>>>>> [SINTOMO: paziente sintomatica per dispnea moderata]
>>>>> [SEGNO: Non edemi]
>>>>> [SEGNO: calo di 2 kg (55,8 kg)]
>>>>> [TERAPIA: ha ridotto la terapia diuretica]
>>>>
>>>>> the same lines as above what I need to write back in the new “clean”
>>>> files are like the following:
>>>>
>>>>> paziente sintomatica per dispnea moderata]
>>>>> Non edemi]
>>>>> calo di 2 kg (55,8 kg)]
>>>>> ha ridotto la terapia diuretica]
>
>> Some call it "pedantry", others "attention to detail" but don't forget
>> the closing square-bracket!
>
> Although, looking at the OPs original post, he retained the closing
> bracket...
> But I think he did intend to remove them...
> So either a slice, or better, rstrip('] ') will deal with those.


Hah! You're correct - I read the word "tags". Further, the idea of using
RegEx seemed to support the idea of finding "contents" rather than
trimming a prefix...

In Italian, do parentheses, brackets, braces, etc, not come in pairs?
-- 
Regards =dn
_______________________________________________
Tutor maillist - Tutor at python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list