Answer to Question #282477 in Python for YASH

Question #282477

Write a python program to create a regular expression to retrieve all words starting with vowels in each string.


1
Expert's answer
2021-12-24T11:37:39-0500
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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS