Write a python program to create a regular expression to retrieve all words starting with vowels in each string.
import re
regex = '^[aeiouAEIOU]*'
def check(string):
if(re.search(regex, string)):
print("Valid")
else:
print("Invalid")
if __name__ == '__main__' :
string = "annie"
check(string)
string = "sandya"
check(string)
Comments
Leave a comment