java - 如何用正则表达式
巴扎黑
巴扎黑 2017-04-18 10:50:24
0
2
659

(?:(?:[0-9]\\d{2}))这个表达式是什么意思

巴扎黑
巴扎黑

reply all(2)
大家讲道理

This brings up the concept of grouping.

The parentheses () in the regular expression will produce grouping. The grouping can use placeholders to represent the matching value in the expression. The grouping starts from 1.

For example: (d+)-1 中的第一个小括号匹配的是 1 个以上的数字,那么分组1表示为 1,整个表达式可以匹配 123-123 This format separates the numbers before and after with a dash.

And if you add ?: 即表示不产生分组号,此时 (?:d+)-1 匹配的就只是 123-1 in brackets.

Although (?:(?:[0-9]d{2})) looks complicated, it actually just matches 3 numbers.

Peter_Zhu

This should be a 3-digit number from 0 to 9.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template