g | x | w | all
Bytes Lang Time Link
094Haskell250820T224443ZHayden B
082Janet250810T225353ZAdam
009Vyxal 3250810T210349Zpacman25
015Uiua250810T193747Znyxbird
040APLNARS250809T042414ZRosario
024Dyalog APL250808T181936ZAaron
150Setanta250807T190621Zbb94
01705AB1E221217T093330ZThe Thon
036Ruby p221224T014513Zsouth
110Ruby 2.7221224T005100ZArmand F
025sed221220T201343ZJiří
026Raku221220T194859ZSean
019Pyth221220T193312ZCursorCo
090Python 3221219T114804ZU13-Forw
016Pip221217T041110Zjezza_99
013Japt221217T165308ZShaggy
052Zsh extendedglob221219T062317Zroblogic
051Factor221219T063900Zchunes
012Jelly221218T223820ZJonathan
080Dart v2.18.4221217T121351ZAlex
065Python 3.8 prerelease221217T021507ZAlephSqu
022Charcoal221217T191959ZNeil
nan221217T043753Zbigyihsu
025Retina 0.8.2221217T185430ZNeil
023Vim221217T172611ZDJMcMayh
056JavaScript Node.js221217T022001ZnaffetS
048R221217T154352Zpajonk
048C clang221217T153953Zjdt
047JavaScript Node.js221217T102932ZArnauld
023Retina221217T134123Zcorvus_1
030Ly221217T053518Zcnamejj
061C clang221217T035540Zdingledo
011Vyxal221217T030851Zlyxal
011Vyxal221217T021318ZnaffetS

Haskell, 94 bytes

import Data.Char
f(x:s)=x:zipWith(#)(x:s)s
x#y|elem x"aeiou"&&notElem y"aeiou"=toUpper y|1>0=y

Try it online!

Janet, 82 bytes

|(peg/replace-all~(%(*'(set"aeiou")(!(set"aeiou"))(/'1,string/ascii-upper)))|$1 $)

Vyxal 3, 9 bytes

A⁜>0pṬ⑴ʁ≜

Vyxal It Online! kind of what everyone else is doing?

Uiua, 15 bytes

⍥¯⊂0⧈<⊸∊"aeiou"

Try it!

⊸∊"aeiou"  # get membership in vowels
⊂0⧈<       # pairwise less-than (prepend 0)
⍥¯         # flip case if true

APL(NARS), 40 chars

2{(⍵∊⎕a∼k)∧⍺∊k←'aeiou':⎕A[⎕a⍳⍵]⋄⍵}/'0',⎕

test:

2{(⍵∊⎕a∼k)∧⍺∊k←'aeiou':⎕A[⎕a⍳⍵]⋄⍵}/'0',⎕    
  ⎕:
  'b'
b
2{(⍵∊⎕a∼k)∧⍺∊k←'aeiou':⎕A[⎕a⍳⍵]⋄⍵}/'0',⎕    
  ⎕:
  'abba'
aBba
2{(⍵∊⎕a∼k)∧⍺∊k←'aeiou':⎕A[⎕a⍳⍵]⋄⍵}/'0',⎕    
  ⎕:
  'ab'
aB
2{(⍵∊⎕a∼k)∧⍺∊k←'aeiou':⎕A[⎕a⍳⍵]⋄⍵}/'0',⎕    
  ⎕:
  'helloworldandhellocodegolf'
heLloWoRldaNdheLloCoDeGoLf

Dyalog APL, 24 chars

{1∘⎕C@{0,2>/⍵∊'aeiou'}⍵}

Explanation

{1∘⎕C@{0,2>/⍵∊'aeiou'}⍵}­⁡​‎‎⁡⁠⁢‏⁠‎⁡⁠⁣‏⁠‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠⁠‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁢⁢‏⁠‎⁡⁠⁢⁢⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤⁡‏⁠‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏⁠‎⁡⁠⁢⁡⁣‏⁠‎⁡⁠⁢⁡⁤‏⁠‎⁡⁠⁢⁢⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏⁠‎⁡⁠⁣⁤‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁤‏⁠‎⁡⁠⁣⁡‏‏​⁡⁠⁡‌­
 1∘⎕C                     # ‎⁡Uppercase
     @{              }⍵   # ‎⁢at the positions this function returns 1
            ⍵∊'aeiou'     # ‎⁣Mark where positions are vowels
         2>/              # ‎⁤Over windows of 2, find where the left is greater to than the right to find right after any string of vowels
       0,                 # ‎⁢⁡Append a zero, so we're never doing the first character
💎

Created with the help of Luminespire.

Setanta, 168 162 150 bytes

gniomh(s){t:=""u:=1le i idir(0,fad@s){d:=aimsigh@(go_liosta@"bcdfghjklmnpqrstvwxyz"())(s[i])t+=(!u&d+1&"BCDFGHJKLMNPQRSTVWXYZ"[d])|s[i]u=d+1}toradh t}

try-setanta.ie link

05AB1E, 17 bytes

'zì.γžMså}2Å€™}J¦

Try it online!

Port of Steffan's Vyxal answer

'zì.γžMså}2Å€™}J¦         # Implicit input                           TOP OF THE STACK:
'zì                       # Prepend a 'z'                            "zhelloworldandhellocodegolf"
   .γ    }                # Group by
     žM                   #  The string of vowels                    'aeiou'
       så                 #  Contains the letter                     ["zh", "e", "ll", "o", "w", "o", "rld", "a", "ndh", "e", "ll", "o", "c", "o", "d", "e", "g", "o", "lf"]
          2Å€ }           # Every second item:
             ™            #  Convert to title case                   ["Zh", "e", "Ll", "o", "W", "o", "Rld", "a", "Ndh", "e", "Ll", "o", "C", "o", "D", "e", "G", "o", "Lf"]
               J          # Join everything                          'ZheLloWoRldaNdheLloCoDeGoLf'
                ¦         # And remove the leading 'z'               'heLloWoRldaNdheLloCoDeGoLf'

Ruby -p, 36 bytes

gsub /(?<=[aeiou])[^aeiou]/,&:upcase

Attempt This Online!

Ruby 2.7, 110 bytes

->(s){v="aeiou";s.chars.map.with_index{v.include?(s[_2-1])&&!v.include?(_1)?(_1.upcase):_1}.join}

sed, 25 bytes

s/[aeiou][^aeiou]/\U\l&/g

Attempt This Online!

It makes the whole match uppercase and then it turns first letter to lowercase. This is 5 bytes shorter than s/([aeiou])([^aeiou])/\1\u\2/g solution and it also doesn't require -E flag.

Raku, 26 bytes

{S:g[<[aeiou]>+<(.]=$/.uc}

Try it online!

Pyth, 19 bytes

sm?*Z!=Z}d"aeiou"r1

Try it online!

Explanation

sm?*Z!=Z}d"aeiou"r1ddQ    # implicitly add ddQ to the end
                          # implicitly assign Q = eval(input())
s                         # sum of
 m                   Q    # map lambda d over Q
  ?                       # ternary if (
   *Z!                    # Z and not
      =Z}d"aeiou"         # assign Z to d being a vowel):
                 r1d      #   d capitalized
                    d     # else: d

Python 3, 90 bytes

lambda x:"".join(b.upper()if a in"aeiou"and b not in"aeiou"else b for a,b in zip(" "+x,x))

Would be 71 bytes if didn't have to deal with repetitive vowels, still got 90 bytes though. Try it online!

Pip, 21 16 bytes

aRXV.XC;@_.UC_@1

Try It Online!

-5 bytes thanks to @DLosc
Regex solution, ported from @Steffan's regex, with some pip builtin regex patterns used to save bytes

Pip, 21 17 bytes

{Iy>YaNVWUC:aa}Ma

Try It Online!

-4 bytes thanks to @DLosc
Non-regex alternative

Japt, 13 bytes

r"%v%c"ÈÎ+XÌu

Try it

r"%v%c"ÈÎ+XÌu     :Implicit input of string
r                 :Replace
 "%v%c"           :RegEx /[aeiou][b-df-hj-np-tv-z]/gi
       È          :Pass each match through the following function as X
        Î         :  First character
         +        :  Append
          XÌ      :  Last character
            u     :  Uppercased

Zsh --extendedglob, 52 bytes

<<<${1//(#m)[aeiou][^aeiou]/$MATCH[1]${(U)MATCH[2]}}

Try it Online!   69 bytes

Hat-tips: one two

Factor, 51 bytes

[ R/ [aeiou][^aeiou]/ [ "\0 "v- ] re-replace-with ]

Try it online!

Jelly, 12 bytes

Œue€ØḄ<ƝŻTƲ¦

A monadic Link that accepts a list of lowercase characters and yields a list of characters.

Try it online!

How?

Œue€ØḄ<ƝŻTƲ¦ - Link: list of lowercase characters, S
           ¦ - sparse application (to S)...
          Ʋ  - ...to indices: last four links as a monad - f(S):
    ØḄ       -     lowercase consonants
   €         -       for each (character in S):
  e          -         exists in? -> 1 if a consonant else 0
       Ɲ     -     for neighbours:
      <      -       less than? -> 1 if [0,1] else 0
        Ż    -     prepend a zero
         T   -     truthy indices -> indices of consonants directly after a vowel
Œu           - ...action: convert to uppercase

Dart (v2.18.4), 149 80 bytes

f(s,[d=0])=>String.fromCharCodes([for(s in s.runes)s^d&~(d=68174912>>s%32)&32]);

Extra test-cases:

Input Output
loremipsumdolorsitamet loReMiPsuMdoLoRsiTaMeT
namauctoranteelementumarculaciniaaceuismodestiaculis naMauCtoRaNteeLeMeNtuMaRcuLaCiNiaaCeuiSmoDeStiaCuLiS

Thanks to @steffan who cut down to 80 bytes (!) by porting @arnauld answer.

Python 3.8 (pre-release), 78 66 65 bytes

d=0
for c in input():print(end=[c,c.upper()][d>(d:=c in"aeiou")])

Complete program. Thanks to @Neil and @Steffan for making this more concise. Try it online!

Python 3, 73 bytes (@Steffan)

lambda x:re.sub("(?<=[aeiou])[^aeiou]",lambda a:a[0].upper(),x)
import re

Function solution. Try it online!

Charcoal, 22 bytes

⭆θ⎇№⌕A⭆θ№aeiouλ10⊖κ↥ιι

Try it online! Link is to verbose version of code. Explanation: Maps each letter to its vowel-ness as a binary flag, then searches for the substring 10 in the result, the second character of which is where the consonants that needs to be uppercased are.

 θ                      Input string
⭆                       Map over letters and join
   №                    Count of
                  κ     Current index
                 ⊖      Decremented
       θ                In input string
      ⭆                 Map over letters and join
        №               Count of
              λ         Inner letter in
         aeiou          Literal string `aeiou`
    ⌕A                  Find all matches of
               10       Literal string `10`
  ⎇                     If found then
                    ι   Current consonant
                   ↥    Uppercased
                     ι  Else current letter
                        Implicitly print

Go, 170 164 bytes

import(."regexp";."strings")
func f(s string)string{return MustCompile(`[aeiou][^aeiou]`).ReplaceAllStringFunc(s,func(x string)string{return x[:1]+ToUpper(x[1:])})}

Attempt This Online!

No (?<=), non-capturing groups only work with Find(All)String(Submatch) which leads to a longer solution, so this mess is what I've had to come with.

Retina 0.8.2, 25 bytes

T`aeioul`aeiouL`[aeiou]+.

Try it online! Explanation: Transliterates vowels to themselves and other lowercase letters to uppercase letters, but only the letter after a run of vowels. (This is so that a double vowel doesn't confuse the transliteration.)

Alternative, also 25 bytes:

rT`aeioul`aeiouL`[aeiou].

Try it online! Explanation: The r makes it match the pattern from right to left solving the double vowel problem.

Both programs work in Retina 1 but 8 bytes can be saved because the aeiou can be replaced by v in the transliteration patterns.

Vim, 23 keystrokes

:s/[aeiou]\+\zs./\u&/g<cr>

:s/                        # Search and replace...
   [aeiou]\+               #    A string of one or more vowels
            \zs            #    (start the match here)
               .           #    Any character
                           #    (because of greedy matching, this will always be the first consonant)
                /          # Replace with
                 \u        #    Make uppercase
                   &       #    The matched string (after \zs)
                    /g<cr> # Replace all occurrences

JavaScript (Node.js), 56 bytes

x=>x.replace(/(?<=[aeiou])[^aeiou]/g,x=>x.toUpperCase())

Try it online!

Perl 5 -p, 30 27 26 bytes

s/[aeiou]\K[^aeiou]/\U$&/g

Try it online!

-3 bytes thanks to Sisyphus

-1 byte thanks to Jo King

R, 48 bytes

\(s)gsub("(?<=[aeiou])([^aeiou])","\\U\\1",s,,T)

Attempt This Online!

C (clang), 48 bytes

d;f(*s){for(d=1;*s;)*s++^=d-(d='Xz'%*s>0)&32;}

Try it online!

dingledooper's answer as a function.

JavaScript (Node.js), 47 bytes

Expects and returns a string.

s=>Buffer(s).map(c=>c^s&~(s=68174912>>c)&32)+''

Try it online!

How?

The constant \$68174912\$ (which I've already used here) is a bitmask describing the positions of the vowels:

00000100000100000100010001000000
     v     v     v   v   v
zyxwvutsrqponmlkjihgfedcba`_^]\[

Commented

s =>           // s = input string
Buffer(s)      // turn it into a buffer
.map(c =>      // for each ASCII code c:
  c ^          //   toggle the case if
  s &          //   the previous letter was a vowel
  ~(           //   and the current letter is a consonant
    s =        //   save in s the new state obtained by
      68174912 //   right-shifting the bit-mask
      >> c     //   by c positions (mod 32)
  ) & 32       //   isolate the case bit
) + ''         // end of map(), coerce back to a string

JavaScript (ES6), 38 bytes

Expects and returns an array of ASCII codes.

a=>a.map(p=c=>c^p&~(p=68174912>>c)&32)

Try it online!

Retina, 23 bytes

(?<=[aeiou])[^aeiou]
$u

Try it online!

$u is replace with uppercase.

Ly, 30 bytes

"aeiou"0>ir[sp<l~!' **lf-ol~>]

Try it online!

This isn't even close to the smallest, but the way it works is probably very different from other languages, so I thought it was worth posting.

It uses two stacks, one with a list of vowels, and one with the STDIN string. Each character on the STDIN stack is copied to the vowel stack and the code search to see if there's a match. That "am I a vowel" result is combined with a "was the last char as vowel" result that lives on the stack to decide whether or not to capitalize the current character before printing it.

"aeiou"                        - push "is a vowel" comparison data on stack
       0                       - push "0" as "was last char a vowel" starter val
        >i                     - switch to new stack, read STDIN onto it
          r                    - reverse stack
           [                 ] - for each input char/codepoint
            sp<l               - stash the char, delete, switch stacks and restore
                ~!             - search for the char in "aeiou", negate result
                  '            - push " " (32), the "capitalize" codepoint offset
                    *          - multiple to clear if not this IS a vowel
                     *         - multiple against "was previous char vowel?" result 
                      l        - reload the current char/codepoint
                       f-      - flip stack and subtract to capitalize if needed
                         o     - output current char
                          l~   - reload char, search against vowels
                            >  - switch back to the STDIN stack

C (clang), 61 bytes

A full program that takes input from STDIN, and outputs to STDOUT.

c;main(d){for(;read(0,&c,1);)putchar(c^d-(d='Xz'%c>0)&32);}

Try it online!

I use the same formula to check for vowels as in this other task. Here, (d='Xz'%c>0) sets d equal to \$ 0 \$ if the current letter c is a vowel, and \$ 1 \$ otherwise. c should be uppercased if and only if the current d is \$ 1 \$, and the previous d is \$ 0 \$. To apply the uppercasing, c is XOR'ed with \$ 32 \$, but only when the conditions are met. Below is a table to visualize what is happening:

 | prev_d | d | prev_d - d | & 32 | ^ c  |
-+--------+---+------------+------+------+-
 |    0   | 0 |      0     |   0  |   c  |
 |    0   | 1 |     -1     |  32  | 32^c |
 |    1   | 0 |      1     |   0  |   c  |
 |    1   | 1 |      0     |   0  |   c  |

Vyxal, 11 bytes

`° ß`$‡ǐNøṙ

Try it Online!

An alternate 11 byter that uses regex

See this golfing tip of mine that explains why the string "° ß" is "[aeiou] [bcdfghjklmnpqrstvwxyz]"

Explained

`° ß`$‡ǐNøṙ
`° ß`       # The string `[aeiou] [bcdfghjklmnpqrstvwxyz]`
     $      # Make the stack input, ^
      ‡ǐN   # Push a function that title cases a string and then swapscase.
            # This is because regex matches will be vowel-consonant, and title case makes the vowel uppercase, consonant lowercase, swapcase inverts that for the desired result 
         øṙ # Apply that function to regex matches in the input

Vyxal, 11 bytes

\zp⁽AḊ⁽ǐẆṅḢ

Try it Online!

This is a terrible way to do it but it works.

\zp⁽AḊ⁽ǐẆṅḢ
\zp         # Prepend "z" so that there is a leading consonant
   ⁽AḊ      # Adjacent-group by is-vowel
      ⁽ǐẆ   # Title-case every second item, starting on the first item
         ṅḢ # Join by nothing and remove the leading "z"