In the following string,
how can get the content including the brackets which are in String 4 using Regex expression.
I am hopping to get back the complete
['*.*String4*.*]. The regex should find the nearest '[' and ']' from 'string 4'.
I am currently using
'\\[(.*?)string 4(.*)\\]' but its matching the first '[' and the last ']', meaning the entire length of the string is getting matched. I am sure it must be easy but i am not getting it, help me pls!