Or this:
DECLARE @pString VARCHAR(8000) = '-[ab]+[cd]-[ef]';
WITH E1(N) AS (
SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL
SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL
SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1
), --10E+1 or 10 rows
E2(N) AS (SELECT 1 FROM E1 a, E1 b), --10E+2 or 100 rows
E4(N) AS (SELECT 1 FROM E2 a, E2 b), --10E+4 or 10,000 rows max
cteTally(N) AS (--==== This provides the "zero base" and limits the number of rows right up front
-- for both a performance gain and prevention of accidental "overruns"
SELECT 0 UNION ALL
SELECT TOP (DATALENGTH(ISNULL(@pString,1))) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM E4
),
cteStart(N1, pString) AS (--==== This returns N+1 (starting position of each "element" just once for each delimiter)
SELECT t.N+1, pString
FROM cteTally t
CROSS APPLY (SELECT pString = CASE WHEN LEFT(@pString,1) IN ('+','-') THEN STUFF(@pString,1,1,'') ELSE @pString END) x
WHERE SUBSTRING(x.pString,t.N,1) IN ('+','-') OR t.N = 0
)
--===== Do the actual split. The ISNULL/NULLIF combo handles the length for the final element when no delimiter is found.
SELECT
ItemNumber = ROW_NUMBER() OVER(ORDER BY s.N1),
Items = REPLACE(REPLACE(
SUBSTRING(pString,s.N1,ISNULL(NULLIF((LEAD(s.N1,1,1) OVER (ORDER BY s.N1) - 1),0)-s.N1,8000))
,'[',''),']',''),
Signs = CASE
WHEN s.N1-1 = 0 THEN CASE WHEN LEFT(@pString,1) ='-' THEN '-' ELSE '+' END
ELSE SUBSTRING(pString,s.N1-1,1) END
FROM cteStart s;
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden