for example' string matches pattern '[ - ][ - ][ - ]*'no matches pattern '[ - ][ - ][ - ]*'matches pattern '[ - ]*the plus (+sign in pattern behaves similarly to an asteriskit states that the previous pattern can be repeated one or more timesbutunlike the asterisk is not optional the question mark (?ensures pattern shows up exactly zero or one timesbut not more let' explore some of these by playing with numbers (remember that \ matches the same character class as [ - ]' matches pattern '\ +\ +' matches pattern '\ +\ +' does not match pattern '\ +\ +' %matches pattern '\ ?\ %' %matches pattern '\ ?\ %' %does not match pattern '\ ?\ %grouping patterns together so far we've seen how we can repeat pattern multiple timesbut we are restricted in what patterns we can repeat if we want to repeat individual characterswe're coveredbut what if we want repeating sequence of charactersenclosing any set of patterns in parenthesis allows them to be treated as single pattern when applying repetition operations compare these patterns'abcccmatches pattern 'abc{ }'abcccdoes not match pattern '(abc){ }'abcabcabcmatches pattern '(abc){ }combined with complex patternsthis grouping feature greatly expands our pattern-matching repertoire here' regular expression that matches simple english sentences'eat matches pattern '[ - ][ - ]*[ - ]+)*$'eat more good food matches pattern '[ - ][ - ]*[ - ]+)*$' good meal matches pattern '[ - ][ - ]*[ - ]+)*$the first word starts with capitalfollowed by zero or more lowercase letters thenwe enter parenthetical that matches single space followed by word of one or more lowercase letters this entire parenthetical is repeated zero or more timesand the pattern is terminated with period there cannot be any other characters after the periodas indicated by the matching the end of string