来自Pattern http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.htmljava文档:
Greedy quantifiers:
X? X, once or not at all
X* X, zero or more times
X+ X, one or more times
X{n} X, exactly n times
X{n,} X, at least n times
X{n,m} X, at least n but not more than m times
Reluctant quantifiers:
X?? X, once or not at all
X*? X, zero or more times
X+? X, one or more times
X{n}? X, exactly n times
X{n,}? X, at least n times
X{n,m}? X, at least n but not more than m times
他们所做的事情的描述是相同的......那么,有什么区别呢?
我真的很感激一些例子。
我正在使用 Java 进行编码,但我听说这个概念对于大多数现代正则表达式实现来说是相同的。