4 replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/

## Retina, 33 bytes

.+
$* ^11 a¶b +¶(.+?)1 ¶$1¶$%$1


Try it online!

Saved 10 (!) bytes thanks to @MartinEnderMartinEnder!

### Explanation

Converts the input to unary, subtracts 2 and adds the a and the b, then recursively replaces the remaining 1s with the concatenation of the two previous strings.

## Retina, 33 bytes

.+
$* ^11 a¶b +¶(.+?)1 ¶$1¶$%$1


Try it online!

Saved 10 (!) bytes thanks to @MartinEnder!

### Explanation

Converts the input to unary, subtracts 2 and adds the a and the b, then recursively replaces the remaining 1s with the concatenation of the two previous strings.

## Retina, 33 bytes

.+
$* ^11 a¶b +¶(.+?)1 ¶$1¶$%$1


Try it online!

Saved 10 (!) bytes thanks to @MartinEnder!

### Explanation

Converts the input to unary, subtracts 2 and adds the a and the b, then recursively replaces the remaining 1s with the concatenation of the two previous strings.

3 added 98 characters in body

## Retina, 4333 bytes

.+
$* 11(1*)^11 a¶b$1a¶b
+(.+)¶+¶(.+?)1
11(1*)
^11
a¶b
+¶(.+?)1
¶$1¶$%$1  Try it online! Saved 10 (!) bytes thanks to @MartinEnder! ### Explanation Converts the input to unary, subtracts 2 and adds the a and the b, then recursively replaces the remaining 1s with the concatenation of the two previous strings. 2 -2 bytes using ungreedy modifier ## Retina, 4543 bytes .+$*
11(1*)
a¶b¶$1a¶b$1
+(.+)¶(.+)¶1
$1¶$2¶$1$2¶


Try it online!

or

.+
$* 11(1*) a¶b$1
+(.+)¶([ab]+?)1
$1¶$2¶$1$2


### Explanation

Converts the input to unary, subtracts 2 and adds the a and the b, then recursively replaces the remaining 1s with the concatenation of the two previous lines strings.

## Retina, 45 bytes

.+
$* 11(1*) a¶b¶$1
+(.+)¶(.+)¶1
$1¶$2¶$1$2¶


Try it online!

or

.+
$* 11(1*) a¶b$1
+(.+)¶([ab]+)1
$1¶$2¶$1$2


Try it online!

### Explanation

Converts the input to unary, subtracts 2 and adds the a and the b, then recursively replaces the remaining 1s with the concatenation of the two previous lines strings.

## Retina, 43 bytes

.+
$* 11(1*) a¶b$1
+(.+)¶(.+?)1
$1¶$2¶$1$2


Try it online!

### Explanation

Converts the input to unary, subtracts 2 and adds the a and the b, then recursively replaces the remaining 1`s with the concatenation of the two previous strings.

1