I need to construct a regex given an integer n that matches any partition of n with a leading +. For example, if n=10, it should match +10, +9+1, +1+9, +1+8+1 etc.

Since there are only finitely many partitions, I could just list them all. For n=10, this is the result:

\+10|\+9\+1|\+8\+2|\+8\+1\+1|\+7\+3|\+7\+2\+1|\+7\+1\+2|\+7\+1\+1\+1|\+6\+4|\+6\+3\+1|\+6\+2\+2|\+6\+2\+1\+1|\+6\+1\+3|\+6\+1\+2\+1|\+6\+1\+1\+2|\+6\+1\+1\+1\+1|\+5\+5|\+5\+4\+1|\+5\+3\+2|\+5\+3\+1\+1|\+5\+2\+3|\+5\+2\+2\+1|\+5\+2\+1\+2|\+5\+2\+1\+1\+1|\+5\+1\+4|\+5\+1\+3\+1|\+5\+1\+2\+2|\+5\+1\+2\+1\+1|\+5\+1\+1\+3|\+5\+1\+1\+2\+1|\+5\+1\+1\+1\+2|\+5\+1\+1\+1\+1\+1|\+4\+6|\+4\+5\+1|\+4\+4\+2|\+4\+4\+1\+1|\+4\+3\+3|\+4\+3\+2\+1|\+4\+3\+1\+2|\+4\+3\+1\+1\+1|\+4\+2\+4|\+4\+2\+3\+1|\+4\+2\+2\+2|\+4\+2\+2\+1\+1|\+4\+2\+1\+3|\+4\+2\+1\+2\+1|\+4\+2\+1\+1\+2|\+4\+2\+1\+1\+1\+1|\+4\+1\+5|\+4\+1\+4\+1|\+4\+1\+3\+2|\+4\+1\+3\+1\+1|\+4\+1\+2\+3|\+4\+1\+2\+2\+1|\+4\+1\+2\+1\+2|\+4\+1\+2\+1\+1\+1|\+4\+1\+1\+4|\+4\+1\+1\+3\+1|\+4\+1\+1\+2\+2|\+4\+1\+1\+2\+1\+1|\+4\+1\+1\+1\+3|\+4\+1\+1\+1\+2\+1|\+4\+1\+1\+1\+1\+2|\+4\+1\+1\+1\+1\+1\+1|\+3\+7|\+3\+6\+1|\+3\+5\+2|\+3\+5\+1\+1|\+3\+4\+3|\+3\+4\+2\+1|\+3\+4\+1\+2|\+3\+4\+1\+1\+1|\+3\+3\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(2|1\+1))|3(4|3\+1|2(2|1\+1)|1(3|2\+1|1(2|1\+1)))|2(5|4\+1|3(2|1\+1)|2(3|2\+1|1(2|1\+1))|1(4|3\+1|2(2|1\+1)|1(3|2\+1|1(2|1\+1))))|1(6|5\+1|4(2|1\+1)|3(3|2\+1|1(2|1\+1))|2(4|3\+1|2(2|1\+1)|1(3|2\+1|1(2|1\+1)))|1(5|4\+1|3(2|1\+1)|2(3|2\+1|1(2|1\+1))|1(4|3\+1|2(2|1\+1)|1(3|2\+1|1(2|1\+1)))))))))

This is 2561 characters long.

For obvious reasons, both of these aren't very good solutions. Is there a smarter way to do this?

Sorry if this has been answered before, this doesn't lend itself to Googling very easily.