I have the following string:
<code>Prefix/Product-[1stMod-]SubProduct-2ndMod-Patch
</code>
<code>Prefix/Product-[1stMod-]SubProduct-2ndMod-Patch
</code>
Prefix/Product-[1stMod-]SubProduct-2ndMod-Patch
I am trying to extract from the above:
<code>[1stMod-]SubProduct
</code>
<code>[1stMod-]SubProduct
</code>
[1stMod-]SubProduct
where ‘1stMod-‘ may or may not exist
and
<code>2ndMod-Patch
</code>
<code>2ndMod-Patch
</code>
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.