8/15 in two lines of code


So I am clearly no Boss type hero in python yet, however as soon as I saw this question I instantly knew "This is a job for regex". All other methods I explored using were far too verbose and after seeing how some very experienced dev's from other forums handled this problem I was confirmed.

Regex all the way!

import re

def anti_vowel(text):
    return re.sub(r'[aeiouAEIOU]', "", text)

I want to plug the book that I learned regex from but I don't know if I am allowed to here rest assured this book is great!