working with python regular expressions matches the pattern starting at pos if provided and ending at endpos if this is provided (otherwise process the whole stringpattern match(stringposendpos)if zero or more characters at the beginning of string match this regular expressionreturn corresponding match object return none if the string does not match the pattern the pos and endpos are optional and specify the start and end positions within which to search pattern split(stringmaxsplit )identical to the split(functionusing the compiled pattern pattern findall(string[pos[endpos]])similar to the findall (functionbut also accepts optional pos and endpos parameters that limit the search region like for search(pattern finditer(string[pos[endpos]])similar to the finditer(functionbut also accepts optional pos and endpos parameters that limit the search region like for search(pattern sub(replstringcount )identical to the sub(functionusing the compiled pattern pattern subn(replstringcount )identical to the subn(functionusing the compiled pattern pattern pattern the pattern string from which the pattern object was compiled an example of using the compile(function is given below the pattern to be compiled is defined as containing or more digits ( to )import re line 'the price is containsintegers '\ +repattern re compile(containsintegersmatchline repattern search(line if matchline print('line contains number'elseprint('line does not contain number'the compiled pattern can then be used to apply methods such as search(to specific string (in this case held in line the output generated by this isline contains number