Please check the following solution.
It supports unlimited number of hyphens.
It is using XML an XQuery.
XML and XQuery data model is based on ordered sequences. That's why it is so easy to get first, last, or any other item in a sequence.
SQL
-- DDL and sample data population, start
DECLARE @tbl TABLE (id INT IDENTITY PRIMARY KEY, tokens VARCHAR(1000));
INSERT INTO @tbl (tokens) VALUES
('red-green-blue123.23-purple'),
('abc-123-456-789'),
('abc-123'),
('OneAndOnly'),
('arm-leg.123-4.8234 .18-race-bat');
-- DDL and sample data population, end
DECLARE @separator CHAR(1) = '-';
;WITH rs AS
(
SELECT *
, TRY_CAST('<root><r>' +
REPLACE(tokens, @separator, '</r><r>') +
'</r></root>' AS XML) AS xmldata
FROM @tbl
)
SELECT id, tokens
, REPLACE(xmldata.query('if (count(/root/r) gt 1) then data(/root/r[position() ne last()])
else data(/root/r[1])').value('(.)', 'VARCHAR(100)'),SPACE(1),@separator) AS AllButLastToken
, xmldata.query('if (count(/root/r) gt 1) then data(/root/r[last()])
else ()').value('(.)', 'VARCHAR(100)') AS LastToken
FROM rs;
Output
+----+---------------------------------+-----------------------------+-----------+
| id | tokens | AllButLastToken | LastToken |
+----+---------------------------------+-----------------------------+-----------+
| 1 | red-green-blue123.23-purple | red-green-blue123.23 | purple |
| 2 | abc-123-456-789 | abc-123-456 | 789 |
| 3 | abc-123 | abc | 123 |
| 4 | OneAndOnly | OneAndOnly | |
| 5 | arm-leg.123-4.8234 .18-race-bat | arm-leg.123-4.8234-.18-race | bat |
+----+---------------------------------+-----------------------------+-----------+