I am trying to extract text between a word and a symbol.
Here is the input table.
And my expected output is like this.
I do not want to have the word ‘Team:’ and ‘<>’ in the output.
I tried something like this but it keeps the ‘Team:’ and ‘<>’ in the output: data[new col]=data[‘Team’].str.extract(r'(Team:\s[a-zA-Z\s]+<>)
Use regex captured group for
[^<>]+– matches any character except