I have the following string:
Prefix/Product-[1stMod-]SubProduct-2ndMod-Patch
I am trying to extract from the above:
[1stMod-]SubProduct
where ‘1stMod-‘ may or may not exist
and
2ndMod-Patch
where ‘2ndMod-‘ does actually exist.
As such, ‘[1stMod-]SubProduct’ is between the first dash and the second to last dash and ‘2ndMod-Patch’ is after the second to last dash through the end.