I'm trying to find a smart and quick solution to extract some DATA from a string.
Basically i wanna get all text inside the '(...)'
Example:
ex_string= "My Cell Phone number is (21) 99715-5555"
return = 21
ex_string2 = "Apple (AAPL) have a great quarterly, but Microsoft (MSFT) have a better one"
return = ['AAPL', 'MSFT']
ex_string3 = "Hello World"
return = None
The trick is some strings will have just one item, another will have more then one and another none.
I know i can just .split('(') then start getting the items, but trying to find better solution for this case, because i will parse tons of string.