I am trying to separate the following string into a separate lines with regular expression
[property1=text1][property2=text2]
and the desired result should be
property1=text1
property2=text2
here is my code
string[] attrs = Regex.Split(attr_str, @"\[(.+)\]");
Results is incorrect, am probably doing something wrong

UPDATE: after applying the suggested answers. Now it shows spaces and empty string

.+is a greedy match, so it grabs as much as possible.Use either
or
In the first case, matching
]is not allowed, so “as much as possible” becomes shorter. The second uses a non-greedy match.