I have a collection of strings that take, for example, the following form:
(GOOGL) [ST]S (partial) 02/01/2024 03/01/2024 $1,001 - $15,000(PHG) [ST]P 02/12/2024 03/01/2024 $1,001 - $15,000(PFE) [ST] P 02/12/2024 03/01/2024 $1,001 - $15,000(UL)[ST]S 02/12/2024 03/01/2024 $1,001 - $15,000I'd like to find a pattern to return the thirdmost group of characters (eg, 'S' in the first line) not surrounded by brackets or parens for each row.
The below pattern gets me each of the capitalized character strings (eg, GOOG, ST, S):
([A-Z]+)How would I only return the 'S', 'P', 'P', and 'S' from each line respectively, which will never be surrounded by parentheses or brackets (alternatively, will have at least one of, sometimes both, a space before or after)?