Q:

numpy reg ex delete words before a specific character

text = 'some string... this part will be removed.'
head, sep, tail = text.partition('...')

>>> print head
some string
0
sep = '...'
rest = text.split(sep, 1)[0]
0

New to Communities?

Join the community