贪婪的运算符总是尝试“抓住”尽可能多的输入,而勉强的量词将匹配尽可能少的输入并仍会创建匹配项。
例:
"The red fox jumped over the red fence"/(.*)red/ => 1 = "The red fox jumped over the "/(.*?)red/ => 1 = "The ""aaa"/a?a*/ => 1 = "a", 2 = "aa"/a??a*/ => 1 = "", 2 = "aaa""Mr. Doe, John"/^(?:Mrs?.)?.*b(.*)$/ => 1 = "John"/^(?:Mrs?.)?.*?b(.*)$/ => 1 = "Doe, John"



