We’re rewarding the question askers & reputations are being recalculated! Read more.
7 golfed 1 byte
source | link

JavaScript (ES6), 81 7373 72 bytes

Saved 8 bytes thanks to @Jordan, 1 thanks to @DavidConrad

(a,b)=>aa=>b=>a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/)

Even though .match returns an array, array+array returns a string with the contents of the arrays concatenated (i.e. [0]+[1] returns "01").

Test snippet

f=(a,b)=>consolef=a=>b=>console.log(a,"+",b,"=",a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/))
f("brad",)("angelina")
f("britain",)("exit")
f("ben",)("jennifer")
f("brangelina",)("exit")
f("bill",)("hillary")
f("angelina",)("brad")
f("programming",)("puzzle")
f("code",)("golf")
f("proguzzle","progruzzle")("colf")
f("out",)("go")
<input id=A value="super">
<input id=B value="chafouin">
<button onclick="f(A.value,)(B.value)">Run</button>

Jordan's excellent Ruby solution would be 53 bytes in JS:

x=>x.replace(/([aeiou]+[^aeiou]*){1,2} [^aeiou]*/,"")

JavaScript (ES6), 81 73 bytes

Saved 8 bytes thanks to @Jordan

(a,b)=>a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/)

Even though .match returns an array, array+array returns a string with the contents of the arrays concatenated (i.e. [0]+[1] returns "01").

Test snippet

f=(a,b)=>console.log(a,"+",b,"=",a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/))
f("brad","angelina")
f("britain","exit")
f("ben","jennifer")
f("brangelina","exit")
f("bill","hillary")
f("angelina","brad")
f("programming","puzzle")
f("code","golf")
f("proguzzle","colf")
f("out","go")
<input id=A value="super">
<input id=B value="chafouin">
<button onclick="f(A.value,B.value)">Run</button>

Jordan's excellent Ruby solution would be 53 bytes in JS:

x=>x.replace(/([aeiou]+[^aeiou]*){1,2} [^aeiou]*/,"")

JavaScript (ES6), 81 73 72 bytes

Saved 8 bytes thanks to @Jordan, 1 thanks to @DavidConrad

a=>b=>a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/)

Even though .match returns an array, array+array returns a string with the contents of the arrays concatenated (i.e. [0]+[1] returns "01").

Test snippet

f=a=>b=>console.log(a,"+",b,"=",a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/))
f("brad")("angelina")
f("britain")("exit")
f("ben")("jennifer")
f("brangelina")("exit")
f("bill")("hillary")
f("angelina")("brad")
f("programming")("puzzle")
f("code")("golf")
f("progruzzle")("colf")
f("out")("go")
<input id=A value="super">
<input id=B value="chafouin">
<button onclick="f(A.value)(B.value)">Run</button>

Jordan's excellent Ruby solution would be 53 bytes in JS:

x=>x.replace(/([aeiou]+[^aeiou]*){1,2} [^aeiou]*/,"")
6 added 122 characters in body
source | link

JavaScript (ES6), 81 73 bytes

Saved 8 bytes thanks to @Jordan

(a,b)=>a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/)

Can probably be golfedEven though .match returns an array, array+array returns a string with the contents of the arrays concatenated (i.e. [0]+[1] returns "01").

Test snippet

f=(a,b)=>console.log(a,"+",b,"=",a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/))
f("brad","angelina")
f("britain","exit")
f("ben","jennifer")
f("brangelina","exit")
f("bill","hillary")
f("angelina","brad")
f("programming","puzzle")
f("code","golf")
f("proguzzle","colf")
f("out","go")
<input id=A value="super">
<input id=B value="chafouin">
<button onclick="f(A.value,B.value)">Run</button>

Jordan's excellent Ruby solution would be 53 bytes in JS:

x=>x.replace(/([aeiou]+[^aeiou]*){1,2} [^aeiou]*/,"")

JavaScript (ES6), 81 73 bytes

Saved 8 bytes thanks to @Jordan

(a,b)=>a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/)

Can probably be golfed...

Test snippet

f=(a,b)=>console.log(a,"+",b,"=",a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/))
f("brad","angelina")
f("britain","exit")
f("ben","jennifer")
f("brangelina","exit")
f("bill","hillary")
f("angelina","brad")
f("programming","puzzle")
f("code","golf")
f("proguzzle","colf")
f("out","go")
<input id=A value="super">
<input id=B value="chafouin">
<button onclick="f(A.value,B.value)">Run</button>

Jordan's excellent Ruby solution would be 53 bytes in JS:

x=>x.replace(/([aeiou]+[^aeiou]*){1,2} [^aeiou]*/,"")

JavaScript (ES6), 81 73 bytes

Saved 8 bytes thanks to @Jordan

(a,b)=>a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/)

Even though .match returns an array, array+array returns a string with the contents of the arrays concatenated (i.e. [0]+[1] returns "01").

Test snippet

f=(a,b)=>console.log(a,"+",b,"=",a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/))
f("brad","angelina")
f("britain","exit")
f("ben","jennifer")
f("brangelina","exit")
f("bill","hillary")
f("angelina","brad")
f("programming","puzzle")
f("code","golf")
f("proguzzle","colf")
f("out","go")
<input id=A value="super">
<input id=B value="chafouin">
<button onclick="f(A.value,B.value)">Run</button>

Jordan's excellent Ruby solution would be 53 bytes in JS:

x=>x.replace(/([aeiou]+[^aeiou]*){1,2} [^aeiou]*/,"")
5 added 31 characters in body
source | link

JavaScript (ES6), 81 73 bytes

Saved 8 bytes thanks to @Jordan

(a,b)=>a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/)

Can probably be golfed...

Test snippet

f=(a,b)=>console.log(a,"+",b,"=",a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/))
f("brad","angelina")
f("britain","exit")
f("ben","jennifer")
f("brangelina","exit")
f("bill","hillary")
f("angelina","brad")
f("programming","puzzle")
f("code","golf")
f("proguzzle","colf")
f("out","go")
<input id=A value="super">
<input id=B value="chafouin">
<button onclick="f(A.value,B.value)">Run</button>

Jordan's excellent Ruby solution would be 53 bytes in JS:

x=>x.replace(/([aeiou]+[^aeiou]*){1,2} [^aeiou]*/,"")

JavaScript (ES6), 81 73 bytes

Saved 8 bytes thanks to @Jordan

(a,b)=>a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/)

Can probably be golfed...

Test snippet

f=(a,b)=>console.log(a,"+",b,"=",a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/))
f("brad","angelina")
f("britain","exit")
f("ben","jennifer")
f("brangelina","exit")
f("bill","hillary")
f("angelina","brad")
f("programming","puzzle")
f("code","golf")
f("proguzzle","colf")
f("out","go")
<input id=A value="super">
<input id=B value="chafouin">
<button onclick="f(A.value,B.value)">Run</button>

JavaScript (ES6), 81 73 bytes

Saved 8 bytes thanks to @Jordan

(a,b)=>a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/)

Can probably be golfed...

Test snippet

f=(a,b)=>console.log(a,"+",b,"=",a.match(/.*?(?=(?:[aeiou]+[^aeiou]*){1,2}$)/)+b.match(/[aeiou].*/))
f("brad","angelina")
f("britain","exit")
f("ben","jennifer")
f("brangelina","exit")
f("bill","hillary")
f("angelina","brad")
f("programming","puzzle")
f("code","golf")
f("proguzzle","colf")
f("out","go")
<input id=A value="super">
<input id=B value="chafouin">
<button onclick="f(A.value,B.value)">Run</button>

Jordan's excellent Ruby solution would be 53 bytes in JS:

x=>x.replace(/([aeiou]+[^aeiou]*){1,2} [^aeiou]*/,"")
4 added 31 characters in body
source | link
3 added 239 characters in body
source | link
2 added 404 characters in body
source | link
1
source | link