Capture portion of identity into a variable

We have identities in this format AAA-BBB-CC-xxxxxx
We would like to capture the first three portions (AAA-BBB-CC) into a variable

Is there a way to pull via regex? I think “.*-” should return what we need. But I can’t find out how to set it to a variable

I’ve gotten this far:

:local ident [/system identity get name];

Which returns the full identity

And this will then return AAA:

:local loc [:pick $ident 0 [:find $ident -]];

but that doesn’t seem to work like cut so using 1 doesn’t choose the next field

Any help would be appreciated.

Thanks

If the format is always the same then you can pick it with fixed numbers.

The first is 0 9
The second 11 17

You emulate cut but then you have loop through the string and cut away the first part (3 times -) and then start after the - and :len of string.