outputthe rain in spain exampleprint the part of the string where there was match the regular expression looks for any words that starts with an upper case " "import re txt "the rain in spainx re search( "\bs\ +"txtprint( group()outputspain email validation example validate the email from file as well from string by using regular expressionimporting the module re