i want to replace a unknown string between two strings.
(1(...) 2(...) 3(...))
I use:
sed -i "s/2(.*)/2(new)/g"
but i'm getting. (It take the last ')')
(1(hello) 2(new)
And i want :
(1(...) 2(new) 3(...))
Someone can help me please ?
Edit :
Thank to the answerers, i have another case:
"data_1": [...], "data_2": [...], "data_3": [...]
I want to insert a string between ' "data_2": [ ' and the first occurence of ']' after data_2