Hi there! I've been able to get data with nested parentheses to the point of now only having balanced parentheses, but I'm struggling with removing the text (and ideally parentheses also) when there is nesting. Would ideally like to use prxchange and felt like I kept getting close but not quite there. Have: Want: TTCCH((AA)A)D TTCCHD TTCCH(TT(AA)A)D TTCCHD ABCDEFGH(TTTT)YYYABT ABCDEFGHYYYABT CCGHT()TTCA CCGHTTTCA CHATTTT(A) CHATTTT TATTTT(A) TATTTT CCGG()TTT CCGGTTT CGGAAAA(AA) CGGAAAA CGGAAAA(AA)T CGGAAAAT CGGAAAA((AA)T) CGGAAAA An example already tried but did not work with nesting... although works great with other situations for me: https://communities.sas.com/t5/SAS-Programming/remove-text-inside-brackets-including-brackets/m-p/477689#M123082 Novice here with prxchange, but I was trying something along the lines of new= prxchange('s/[\(+\w+\)+]*//i',-1,old) Would appreciate suggestions, thanks so much!
... View more