Program to check if the string starts with vowel or not using Regex


The task is to check whether the given string starts with vowel using regex expression.

check if the string starts with vowel


import re 

def check_str(ip_str): 
# Regular expression for vowel
    re_exp = '^[aeiouAEIOU][A-Za-z0-9_]*'
    if(, ip_str)):  
        print("The string starts with vowel!")  
        print("The string does not start with vowel!")  
ip_str = input("Enter the string: ")


check if the string starts with vowel Output


In the above python code we have created a regex expression of string starting with vowel and passed the expression and sing in search() method. If the pattern is found, the output “The string starts with vowel!” is printed else “The string does not starts with vowel!” is printed.


  • Barry Allen

    A Full Stack Developer with 10+ years of experience in different domain including SAP, Blockchain, AI and Web Development.

    View all posts


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.