go

(?s)表示任意字符,包括换行符

rsklComp, _ := regexp.Compile(`RiskLevel\]\n((?s).*)\n\[RiskD`)
rskl := rsklComp.FindStringSubmatch(oriStr)
rsklstr = rskl[1]

js

([\s\S]*)表示任意字符,包括换行符

let re_solution = /Solution\]\n([\s\S]*)\n\n\[RiskLevel/
let res_solution = new RegExp(re_solution).exec(str)
console.log(res_solution[1]