Java 正则表达式最大,最小匹配问题

Java 正则表达式最大,最小匹配问题
最大匹配模式
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


你可能感兴趣的:(正则表达式)