regular expressions in python if there is more than one matchonly the first occurrence of the match will be returnedimport re line 'the price is containsintegers '\ +if re search(containsintegersline )print('line contains an integer'elseprint('line does not contain an integer'in this case the output is line contains an integer another example of using the search(function is given below in this case the pattern to look for defines three alternative strings (that is the string must contain either beatlesadele or gorillaz)import re alternative words music 'beatles|adele|gorillazrequest 'play some adeleif re search(musicrequest)print('set fire to the rain'elseprint('no adele available'in this case we generate the outputset fire to the rain the match(function this function attempts to match regular expression pattern at the beginning of string the signature of this function is given belowre match(patternstringflags=