In gotemplate (sprig), given the following strings:
one-use1-dev-01
one-two-use1-dev-01
one-two-three-use1-dev-01
I would like to "chop" off use1-dev-01 and return one, one-two or one-two-three.
use1-dev-01 will always be three segments, but dev could be stage, etc (eg, use1-stage-01).
What is the simplest way to handle this? I'm looking at trying to use regexpReplaceAll or regexpSplit but have been unsuccessful thus far.