Hi I have a string that looks like
string = "Tom (Marketing Assistant)/Gary (Manager)/Forty" and I want to remove all the parts inside the brackets such that the outcome is "Tom/Gary/Forty".
I've tried string %>% str_remove("\\(.+\\)") but the output is "Tom /Forty" and it seems that because the regex matching takes the very first ( and up till the very last ) which I tried visualizing with string %>% str_extract("\\(.+\\)") which gives "(Marketing Assistant)/Gary (Manager)". I can't specify too specific what is inside the bracket because there is a range of characters in the brackets (not all the same), so is there a way to code it in a way that only removes what is inside the brackets, possibly by telling it to stop removing once it encounters / because this follows every bracket?