g | x | w | all
Bytes Lang Time Link
012Uiua240601T104514Znoodle p
151Batch240715T163325ZT3RR0R
034sed240612T074603ZJan Blum
050Google Sheets240531T205754Zz..
040Zsh240603T101254ZGammaFun
050PowerShell Core240603T215033ZJulian
029J from Jsoftware240603T212625Zscara95
019Perl 5 pF[^AEIOUaeiou]240603T140610ZXcali
050Bash240603T100132ZThemooni
046jq240603T102035ZGammaFun
069Java JDK240603T091522Zint 21h
010Brachylog240603T081704ZFatalize
10705AB1E legacy240603T073239ZKevin Cr
086C gcc240601T083520ZArnauld
052R240601T120127Zpajonk
054Python240601T003957ZAlbert.L
023AWK240601T215709Zcorvus_1
128Go240531T194424Zbigyihsu
004Japt v2.0a0240531T204215ZShaggy
030Scala 2240601T190845Zcorvus_1
018Retina240531T225934ZNeil
076Python240531T211200ZSanguine
047JavaScript ES6240531T215706ZArnauld
024Perl 5 lp240601T073227ZNahuel F
034Arturo240601T054214Zchunes
017Uiua SBCS240601T044048Zchunes
003Vyxal 3240601T001808Zlyxal
031Ruby240531T230230ZDingus
014Charcoal240531T214235ZNeil
038APL+WIN240531T204216ZGraham

Uiua, 12 bytes

⊕□∈"AEIOU"⊸⌵

Try it: Uiua pad

group (with boxing) by whether each character is a member of "AEIOU" when ⊸⌵ uppercased.

Batch 151 bytes

@Echo off&Set $=For /f "Delims=" %%G in ('cmd.exe/u/c ^^^"Echo(%1^^^"^^^|find/v ""^^^|findstr/li# "a e i o u"'^)Do ^<nul Set/p=%%G
%$:#=%
Echo(
%$:#=V%

Input is as a parameter from the command line.

How: $ is defined with a macro that enacts tho following logic:

cmd.exe/u/c ^"Echo(%1^"^|find/v "" - Splits the stringt into individual characters

findstr/li# "a e i o u" - print characters matching aeiou if # has been removed during the macros expansion; or prints characters not matching aeiou if # has been substituted with V during expansion.

sed, 34 bytes

h
s/[^aeiou]//gi
p
g
s/[aeiou]//gi

Try it online!

Prints two strings on separate lines.

Bash (+sed), 37 bytes

p=aeiou]//gi
sed "h;s/[^$p;p;g;s/[$p"

Try it online!

Expands to equivalent of

Bash (+sed), 40 bytes

sed 'h
s/[^aeiou]//gi
p
g
s/[aeiou]//gi'

Try it online!

Google Sheets, 50 bytes

Assumes the string is in A1 and it returns the result in two horizontally adjacent cells.

=SORT(REGEXREPLACE(A1,"(?i)["&{"^",""}&"aeiou]",))

Demo

enter image description here

Zsh, 40 bytes

p=aeiouAEIOU
<<<${1//[^$p]}'
'${1//[$p]}

Try it online!

${1//PATTERN} removes all substrings matching PATTERN. The trailing/leading single quote is there to include a literal newline in the string which is printed.

Bash, 41 bytes

-1 byte thanks to @Themoonisacheese

Bash uses a different character for negation in character classes, and requires two more bytes for echo .... But, as @Themoonisacheese points out, the globbing character ] can be included in the parameter, which saves a byte.

p=aeiouAEIOU]
echo ${1//[!$p}'
'${1//[$p}

Try it online! Try it online!

PowerShell Core, 50 bytes

$args|group{$_-in("aeiou"|% t*y)}|%{-join$_.Group}

Try it online!

Takes the input string using splatting
Returns two strings

$args                        # The string as chars
|group{$_-in("aeiou"|% t*y)} # Arranged in groups checking if each char is a vowel or not
|%{-join$_.Group}            # Joined in a string for each group

J from Jsoftware, 29 bytes

(e.(#;]#~[=0:)[)&'aeiouAEIOU'

J from Jsoftware, 32 bytes

((e.#[);[#~0:=e.)&'aeiouAEIOU'

Perl 5 -pF[^AEIOUaeiou], 19 bytes

say@F;s/[aeiou]//ig

Try it online!

Bash, 50 bytes

-8 bytes using stdout, thanks GammaFunction
-1 byte with a better alias, by me
-6 bytes using <<< instead of echo , by me
-8 bytes by removing redundant grep call, which enables me to use a better alias, by me

g="grep -i [aeiou] "
$g-o<<<$1
grep -o .<<<$1|$g-v

Try it online!

use as a script or as the body of a bash function and call with input as first argument. Outputs vowels then consonnants, one per line.

See also: 42 bytes by GammaFunction.

jq, 46 bytes

./""|group_by(inside("aeiouAEIOU"))[]|join("")

Try it online!

group_by takes any filter, so we group by whether each character is inside the string of all vowels.

Java (JDK), 69 bytes

The solution is straightforward containing just two calls to the same method. Smarter would be of course to replace them with a loop like for(char j:{"","^"})r+=s.replaceAll("(?i)["+j+"aeiou]","") but I don't see how to overcome that verbosity ))

s->s.replaceAll("(?i)[^aeiou]","")+" "+s.replaceAll("(?i)[aeiou]","")

Try it online!

Brachylog, 10 bytes

{ḷ∈Ṿ|l}ᵍcᵐ

Try it online!

Explanation

{      }ᵍ      Group by: group letters together if they give the same output
 ḷ∈Ṿ             The letter lowercased is in "aeiou", the output is then "aeiou"
     |           Else (the letter is a consonant)
      l          The output is the length of "aeiou" = 5
         cᵐ    Map concatenate to get 2 strings instead of lists of chars

05AB1E (legacy), 10 (or 7) bytes

žMžN‚Du+€Ã

Try it online or verify multiple test cases at once.

If outputting just a single group when the input only contains vowels or only consonants, it could be 7 bytes in the new version of 05AB1E with a group-by builtin:

.¡žMslå

Try it online or verify multiple test cases at once.

Explanation:

žM         # Push the lowercase vowels constant excluding y
  žN       # Push the lowercase consonants constant including y
    ‚      # Pair the two together
     D     # Duplicate
      u    # Uppercase the strings in the copy
       +   #†Element-wise append them
        €  # Map over both strings:
         Ã #  Keep just those characters from the (implicit) input-string
           # (after which the resulting pair is output implicitly)

†: This is the reason for the legacy version of 05AB1E, which is built in Python, where + can be used to append strings. Whereas in the new version of 05AB1E, built in Elixir, + is only used for numeric calculations.

.¡         # Group the characters in the (implicit) input by:
  žM       #  Push the lowercase vowels constant excluding y
    s      #  Swap so the current character is at the top of the stack
     l     #  Convert it to lowercase
      å    #  Check whether it's in the vowels constant
           # (after which the list of lists of characters is output implicitly)

C (gcc), 86 bytes

Prints the consonants, followed by a space, followed by the vowels.

char*v,*q;f(char*s){for(q=v=s;*v=*s;)2130466>>*s++&1?v++:putchar(*v);printf(" %s",q);}

Try it online!

Method

We use 3 pointers:

pointers

Vowels are identified with the following bitmask:

2130466 = 0b1000001000001000100010
            ^     ^     ^   ^   ^
            u     o     i   e   a

It is assumed that only the 5 least significant bits of the shift amount are taken into account, which is the case for at least Intel and ARM.

R, 52 bytes

\(s,`?`=\(p)gsub(p,"",s,T))c(?"[^aeiou]",?"[aeiou]")

Attempt This Online!

Explanation outline

Python, 54 bytes

lambda s:"".join(sorted(s+" ",key="aiueoAIUEO".count))

Attempt This Online!

Returns a single string with the two parts separated by a space.

Python, 57 bytes (@Mukundan314)

o=2*[""]
for x in input():o[x in"aiueoAIUEO"]+=x
print(o)

Attempt This Online!

Python, 58 bytes

o=["",""]
for x in input():o[x in"aiueoAIUEO"]+=x
print(o)

Attempt This Online!

Full program.

Python, 66 bytes (@Mukundan314)

lambda s,v="aiueoAIUEO":[v:=[i for i in s if{i}-{*v}]for _ in"xx"]

Attempt This Online!

Outputs lists of characters.

Python, 70 bytes

lambda s,v="aiueoAIUEO":[v:="".join(x.strip(v)for x in s)for _ in"xx"]

Attempt This Online!

Python, 72 bytes

lambda s,v="aiueoAIUEO":[v:="".join(x*-v.find(x)for x in s)for _ in"xx"]

Attempt This Online!

Python, 77 bytes

lambda s,v="aiueoAIUEO":[v:=s.translate({}.fromkeys(v.encode()))for _ in"xx"]

Attempt This Online!

AWK, 23 bytes

Using flags -vIGNORECASE=1 -vRS=[aiueo]+.

{printf RT;printf$0>FS}

Prints vowels to stdout and consonants to a file called (single space).

Attempt This Online!

Go, 132 128 bytes

import."strings"
func f(s string)(c,v string){for i:=range s{if r:=s[i:i+1];ContainsAny(r,"aeiouAEIOU"){v+=r}else{c+=r}}
return}

Attempt This Online!

Loops over each character, checks to see if it is one of "aeiouAEIOU", and appends it to the corresponding output string.

c is the consonants, and v is the vowels.

Japt v2.0a0, 4 bytes

üè\c

Try it

üè\c     :Implicit input of string
ü        :Group & sort by
 è       :  Count of
  \c     :    RegEx character class for consonants

Scala 2, 30 bytes

_.partition("aiueoAIUEO"toSet)

Attempt This Online!

Retina, 18 bytes

*\T`Vv`_
T`Vvp`Vv_

Try it online! Outputs the consonants followed by the vowels. Explanation:

*\`

Run the stage and print the results but don't save them, so the next stage uses the original input.

T`Vv`_

Delete all upper and lower case vowels from the input.

T`Vvp`Vv_

Keep all upper and lower case vowels but delete all other printable ASCII.

This would be a massive 48 bytes in Retina 0.8.2; you do at least save a byte by not needing the explicit \ after the * but Retina 0.8.2 doesn't have V or v so you need to use A\EI\OUaei\ou on the first line and A\EI\OUaeiou twice on the second (o does not need to be quoted if you use it on both sides).

Python, 79 78 76 bytes

-1 from me

-2 from solid.py!

lambda s,l='[aeiouAEIOU]':(sub('[^'+l[1:],'',s),sub(l,'',s))
from re import*

Attempt This Online!

Saved a byte by modifying the regex instead of joining the array from .findall().


Original version (79 bytes)

from re import*
f=lambda s,l='[aeiouAEIOU]':(''.join(findall(l,s)),sub(l,'',s))

Attempt This Online!

Returns a tuple including the vowel string and the consonant string.

JavaScript (ES6), 47 bytes

Returns [ consonants, vowels ].

s=>[s.replace(/[aeiou]/gi,c=>(v+=c,""),v=""),v]

Try it online!

Commented

s => [           // s = input string
  s.replace(     // replace in s:
    /[aeiou]/gi, //   look for all vowels, case insensitive
    c =>         //   for each vowel c:
      (          //
        v += c,  //     append c to v
        ""       //     remove it from the original string
      ),         //
    v = ""       //   start with v = ""
  ),             // end of replace() -> only consonants remain
  v              // return the string of vowels in 2nd position
]                //

Perl 5 -lp, 24 bytes

s/[^AEIOU]/$\.=$&;""/gei

Try it online!

Arturo, 34 bytes

$->s->@[--s<=match s{(?i)[aeiou]}]

Try it!

Outputs a list where the first element is a list of vowels as singleton strings and the second element is a string of consonants.

Explanation

$->s->                ; function taking a string s
@[   ]                ; capture the following in a list:
--                    ; set difference between...
s                     ; input and...
<=                    ; extra copy of...
match s{(?i)[aeiou]}  ; case-insensitive vowels in input

Uiua SBCS, 17 bytes

∩▽¬,,∊,⊂⌵."aeiou"

Try it!

∩▽¬,,∊,⊂⌵."aeiou­⁡​‎‎⁡⁠⁣⁣‏⁠‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏⁠‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏⁠‎⁡⁠⁢⁡⁡‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢⁤‏⁠‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣‏⁠‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌­"
          "aeiou"  # ‎⁡the string 'aeiou'
       ⊂⌵.         # ‎⁢duplicate, uppercase, prepend
     ∊,            # ‎⁣mask of vowels w/ input
  ¬,,              # ‎⁤mask of consonants w/ input
∩▽                 # ‎⁢⁡keep both

Vyxal 3, 3 bytes

⸠AĠ

Try it Online!

Returns a list of [vowels, consonants]

Explained

⸠AĠ­⁡​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌­
  Ġ  # ‎⁡Split the input into groups based on whether
⸠A   # ‎⁢Each character is a vowel
💎

Created with the help of Luminespire.

Ruby, 31 bytes

->s{[v=s.grep(/[aeiou]/i),s-v]}

Try it online!

Input as an array of characters, assumed to contain only uppercase and lowercase letters. Output is a two-element array of vowels followed by consonants, both as arrays of characters.

Charcoal, 14 bytes

E²Φθ⁼ι№aeiou↧λ

Try it online! Link is to verbose version of code. Outputs the consonants then vowels on separate lines. Explanation:

 ²              Literal integer `2`
E               Map over implicit range
   θ            Input string
  Φ             Filtered where
      №         Count of
             λ  Current character
            ↧   Lowercased
       aeiou    In literal string `aeiou`
    ⁼           Equals
     ι          Outer value
                Implicitly print

APL+WIN, 38 bytes

Prompts for word and outputs consonants followed by vowels in the order they appear in the word. Can be 4 bytes shorter if order does not matter.

(s~v),' ',v[((v←'AaEeIiOoUu')⍳s←⎕)~11]

Try it online! Thanks to Dyalog Classic