Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

60%
+1 −0
Challenges Just the vowels please

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...

posted 2y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
#2: Post edited by user avatar Shaggy‭ · 2022-10-10T13:44:19Z (about 2 years ago)
  • # 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 by user avatar Shaggy‭ · 2022-10-09T14:00:56Z (about 2 years ago)
# 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)