input file :
key1=1
key2=start(a
b
c=
d)end
key3=d=e=f
somekey=start(123)end
morekey=start(1
2)end
key=jj
output
key1 -> 1
key2 -> a
b
c=
d
key3 -> d=e=f
somekey -> 123
morekey -> 1
2
key -> jj
Request : Trying in java. Can't use java.util.Properties, regex is fine but not preferred, prefer StringUtils.substringBetween, but regex will do. How can I traverse through multiple lines and preserve newlines too. The following obviously dont work for multilines. Was going to try regex, but only if a more elegant way is not possible.
String[] str = line.split("=", 2);
StringUtils.substringBetween(line,startString,endString));