Skip to main content
added 17 characters in body
Source Link
Neil
  • 177.2k
  • 12
  • 74
  • 281

Retina, 113 81 80 77 7070 68 bytes

M1!`.+[A-Zz]|...s.s?|M[io]n?t?|[AFIOUWN][^o]v?|T..|.*
\B.*(?=.)

T`l`L

Try it online!Try it online! Includes all 51 test cases. Saved 32 bytes by appropriating @JörgHülsermann's regex that finds the second letter (with a tweak to support DC; edit: saved 1 byte thanks to @JörgHülsermann). Saved 3 bytes by switching to @SteveBennett's regex from his comment to @HPWilliam's answer. Saved 77 9 bytes thanks again to @SteveBennett. The other letters are then deleted and the string uppercased.

Retina, 113 81 80 77 70 bytes

M1!`.+[A-Zz]|...s.s?|M[io]n?t?|[AFIOUWN][^o]v?|T..|.*
\B.*(?=.)

T`l`L

Try it online! Includes all 51 test cases. Saved 32 bytes by appropriating @JörgHülsermann's regex that finds the second letter (with a tweak to support DC; edit: saved 1 byte thanks to @JörgHülsermann). Saved 3 bytes by switching to @SteveBennett's regex from his comment to @HPWilliam's answer. Saved 7 bytes thanks again to @SteveBennett. The other letters are then deleted and the string uppercased.

Retina, 113 81 80 77 70 68 bytes

M1!`.+[A-Zz]|...s.s?|M[io]n?t?|[AFIOUWN][^o]v?|T..|.*
\B.*(?=.)

T`l`L

Try it online! Includes all 51 test cases. Saved 32 bytes by appropriating @JörgHülsermann's regex that finds the second letter (with a tweak to support DC; edit: saved 1 byte thanks to @JörgHülsermann). Saved 3 bytes by switching to @SteveBennett's regex from his comment to @HPWilliam's answer. Saved 7 9 bytes thanks again to @SteveBennett. The other letters are then deleted and the string uppercased.

added 41 characters in body
Source Link
Neil
  • 177.2k
  • 12
  • 74
  • 281

Retina, 113 81 80 7777 70 bytes

M1!`.+[A-Zz]|Nev?|Zz]|.*sk|M.ss.s.s?|M[io]n?t?|[AFIOUW][^o]|Te|[AFIOUWN][^o]v?|T..|.+*
\B.*(?=.)

T`l`L

Try it online!Try it online! Includes all 51 test cases. Saved 32 bytes by appropriating @JörgHülsermann's regex that finds the second letter (with a tweak to support DC; edit: saved 1 byte thanks to @JörgHülsermann). Saved 3 bytes by switching to @SteveBennett's regex from his comment to @HPWilliam's answer. Saved 7 bytes thanks again to @SteveBennett. The other letters are then deleted and the string uppercased.

Retina, 113 81 80 77 bytes

M1!`.+[A-Zz]|Nev?|.*sk|M.ss.s?|M[io]n?t?|[AFIOUW][^o]|Te.|.+
\B.*(?=.)

T`l`L

Try it online! Includes all 51 test cases. Saved 32 bytes by appropriating @JörgHülsermann's regex that finds the second letter (with a tweak to support DC; edit: saved 1 byte thanks to @JörgHülsermann). Saved 3 bytes by switching to @SteveBennett's regex from his comment to @HPWilliam's answer. The other letters are then deleted and the string uppercased.

Retina, 113 81 80 77 70 bytes

M1!`.+[A-Zz]|...s.s?|M[io]n?t?|[AFIOUWN][^o]v?|T..|.*
\B.*(?=.)

T`l`L

Try it online! Includes all 51 test cases. Saved 32 bytes by appropriating @JörgHülsermann's regex that finds the second letter (with a tweak to support DC; edit: saved 1 byte thanks to @JörgHülsermann). Saved 3 bytes by switching to @SteveBennett's regex from his comment to @HPWilliam's answer. Saved 7 bytes thanks again to @SteveBennett. The other letters are then deleted and the string uppercased.

deleted 167 characters in body
Source Link
Neil
  • 177.2k
  • 12
  • 74
  • 281

Retina, 113 81 80 7977 bytes

M1!`.*+[A-Zz]|Nev?([vxz]| [^o]|owa|lask|[CGHKLPV]|.*|ssi*sk|M.ss.s?|M[io]n?t?|[AFIOUW][^o]|Te.|n(n|t|d|e$))|..+
\B.*(?=.)

T`l`L

Try it online!Try it online! Includes all 51 test cases. Saved 32 3332 bytes by appropriating @JörgHülsermann's regex that finds the second letter (with a tweak to support DC; edit: saved 1 byte thanks to @JörgHülsermann; edit: copied a subsequent 1 byte saving@JörgHülsermann). Saved 3 bytes by switching to @SteveBennett's regex from his comment to @HPWilliam's answer. The other letters are then deleted and the string uppercased. I couldn't work out how to adapt @SteveBennett's regex; @HPWilliam's regex works although it's currently two bytes longer (although @SteveBennett's comment has a version which works out at the same length).

Retina, 113 81 80 79 bytes

M1!`.*?([vxz]| [^o]|owa|lask|[CGHKLPV].*|ssi?.|n(n|t|d|e$))|..
\B.*(?=.)

T`l`L

Try it online! Includes all 51 test cases. Saved 32 33 bytes by appropriating @JörgHülsermann's regex that finds the second letter (with a tweak to support DC; edit: saved 1 byte thanks to @JörgHülsermann; edit: copied a subsequent 1 byte saving). The other letters are then deleted and the string uppercased. I couldn't work out how to adapt @SteveBennett's regex; @HPWilliam's regex works although it's currently two bytes longer (although @SteveBennett's comment has a version which works out at the same length).

Retina, 113 81 80 77 bytes

M1!`.+[A-Zz]|Nev?|.*sk|M.ss.s?|M[io]n?t?|[AFIOUW][^o]|Te.|.+
\B.*(?=.)

T`l`L

Try it online! Includes all 51 test cases. Saved 32 bytes by appropriating @JörgHülsermann's regex that finds the second letter (with a tweak to support DC; edit: saved 1 byte thanks to @JörgHülsermann). Saved 3 bytes by switching to @SteveBennett's regex from his comment to @HPWilliam's answer. The other letters are then deleted and the string uppercased.

added 62 characters in body
Source Link
Neil
  • 177.2k
  • 12
  • 74
  • 281
Loading
added 63 characters in body
Source Link
Neil
  • 177.2k
  • 12
  • 74
  • 281
Loading
added 257 characters in body
Source Link
Neil
  • 177.2k
  • 12
  • 74
  • 281
Loading
Source Link
Neil
  • 177.2k
  • 12
  • 74
  • 281
Loading