table regular expression quantifiers syntax meaning eor { , greedily match zero or one occurrence of expression ?or { , }nongreedily match zero or one occurrence of expression eor { ,greedily match one or more occurrences of expression +or { ,}nongreedily match one or more occurrences of expression eor { ,greedily match zero or more occurrences of expression *or { ,}nongreedily match zero or more occurrences of expression {mmatch exactly occurrences of expression { ,greedily match at least occurrences of expression { ,}nongreedily match at least occurrences of expression {,ngreedily match at most occurrences of expression {, }nongreedily match at most occurrences of expression { ,ngreedily match at least and at most occurrences of expression nongreedily match at least and at most occurrences of expression { , }it is often possible to convert uses to uses and vice versa for examplewe could match "tasselledwith at least one using tassell*ed or tassel+edand match those with two or more ls using tasselll*ed or tassell+ed if we use the regex \dit will match but why does it match all the digitsrather than just the first oneby defaultall quantifiers are greedy--they match as many characters as they can we can make any quantifier nongreedy (also called minimalby following it with symbol (the question mark has two different meanings--on its own it is shorthand for the { , quantifierand when it follows quantifier it tells the quantifier to be nongreedy for example\ +can match the string in three different places and here is another example\ ?matches zero or one digitsbut prefers to match none since it is nongreedy--on its own it suffers the same problem as in that it will match nothingthat isany text at all nongreedy quantifiers can be useful for quick and dirty xml and html parsing for exampleto match all the image tagswriting (match one "<"then one " "then one " "then one " "then zero or more of any character apart from newlinethen one ">"will not work because the part is greedy and will match everything including the tag' closing >and will keep going until it reaches the last in the entire text