Post History
JavaScript, 27 24 bytes Input as a string, output as a character array or empty array. s=>s.split(/[^aeiou]*/i) Try it online! Thanks to Moshi for pointing out the * I was missing that w...
Answer
#2: Post edited
# JavaScript, 27 bytes- Input as a string, output as a character array or empty array.
- <!-- language-all: lang-javascript -->
s=>s.match(/[aeiou]/gi)||[][Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@7/Y1q5YLzexJDlDQz86MTUzvzRWPz1Ts6YmOvZ/cn5ecX5Oql5OfrpGmkZCok@Ja5FfYkhqgqbmfwA)
- # JavaScript, <s>27</s> 24 bytes
- Input as a string, output as a character array or empty array.
- <!-- language-all: lang-javascript -->
- s=>s.split(/[^aeiou]*/i)
- [Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@7/Y1q5Yr7ggJ7NEQz86LjE1M780Vks/U/N/cn5ecX5Oql5OfrpGmkZCok@Ja5FfYkhqgqbmfwA)
- Thanks to Moshi for pointing out the `*` I was missing that would allow me to use `split` instead of `match` and get down to 24 bytes.
#1: Initial revision
# JavaScript, 27 bytes Input as a string, output as a character array or empty array. <!-- language-all: lang-javascript --> s=>s.match(/[aeiou]/gi)||[] [Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@7/Y1q5YLzexJDlDQz86MTUzvzRWPz1Ts6YmOvZ/cn5ecX5Oql5OfrpGmkZCok@Ja5FfYkhqgqbmfwA)