Split text based on specific character, but retain character

Hi,

Question:

The is a list containing multiple items with characters.

I would like to get all the text after a - or + character.

This is possible with the split text component, however, than the - or + value is ‘deleted’.

Any idea how to overcome. (offcourse it is possible to contact the item but would like to avoid it. Thanks :slight_smile:

2020-10-15 retrieve text part after + or - sing (incl + or - sign).gh (9.6 KB)

Any suggestions?

Thanks :slight_smile:(upload://8lGqdCt0jh7PDkq63a0cFyFbUIy.gh) (9.6 KB)

import re
t = ''.join(re.split('([-+])',x)[1:])
a = t if t else None

TextSplit.gh (5.9 KB)

2 Likes