最大匹配模式 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 最小匹配模式 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
正则表达式写过不少,javascript貌似默认为最小匹配的。一直不知道JAVA正则的最小匹配须要在后面加个?号。这里给本身作一下笔记。