I have string in two different format like following how to I write a RegExp in js to parse the information to get appName1-v10.20. under Package: ?
//example string
const twoMatchString = '\[Package: [appName1-v10.20.1](https://github.com/appName1/1111), [appName2-v20.15.10](https://github.com/appName2/aaa)\]\r\n[asdsad: asdas]\r\ni am description on PR'
const oneMatchString = '[Package: appName1-v10.20.1](https://github.com/appName1/1111)\r\n[asdsad: asdas]\r\ni am description on PR'
const reg = /\[Package:\s?(.+?,?)\]/g
const twoMatch = twoMatchString.matchAll(reg);
const oneMatch = oneMatchString.matchAll(reg);
console.log(twoMatch ) // wish to have ["appName1-v10.20.1", "appName2-v20.15.10"]
console.log(oneMatch) // wish to have ["appName1-v10.20.1"]