regular expressions ranges of characters in them without having to write each character individually we learned how to quantify expressions to match specific number of times or to match from given minimum to given maximum number of timesand how to use greedy and nongreedy matching we also learned how to group one or more expressions together so that they can be quantified (and optionally capturedas unit the also showed how what is matched can be affected by using various assertionssuch as positive and negative lookahead and lookbehindand by various flagsfor exampleto control the interpretation of the period and whether to use case-insensitive matching the final section showed how to put regexes to use within the context of python programs in this section we learned how to use the functions provided by the re moduleand the methods available from compiled regexes and from match objects we also learned how to replace matches with literal stringswith literal strings that contain backreferencesand with the results of function calls or lambda expressionsand how to make regexes more maintainable by using named captures and comments exercises || in many contexts ( in some web forms)users must enter phone numberand some of these irritate users by accepting only specific format write program that reads phone numbers with the three-digit area and seven-digit local codes accepted as ten digitsor separated into blocks using hyphens or spacesand with the area code optionally enclosed in parentheses for exampleall of these are valid( ( and read the phone numbers from sys stdin and for each one echo the number in the form "( or report an error for any that are invalidor that don' have exactly ten digits the regex to match these phone numbers is about ten lines long (in verbose modeand is quite straightforward solution is provided in phone pywhich is about twenty-five lines long write small program that reads an xml or html file specified on the command line and for each tag that has attributesoutputs the name of the tag with its attributes shown underneath for examplehere is an extract from the program' output when given one of the python documentation' index html fileshtml xmlns