我有以下十进制数字序列(最多两位):
1.2,1.30,1.45,1.6
我尝试了以下方式,但是它不接受多个逗号和多个点:
^[0-9]{1,2}([,.][0-9]{1,2})?$
可以对其进行哪些更改。
答案 0 :(得分:1)
您可以将问号// Overlay logo
// src = 3 channel image of a room
// logo = 3 channel image of a logo (most of the Mat is black except for the logo).
// logo is smaller than the room image
Mat res;
Mat thresh;
src.copyTo(res);
threshold(logo, thresh, 1, 255, CV_THRESH_BINARY);
Rect r(res.cols-logo.cols, res.rows-logo.rows, logo.cols, logo.rows);
logo.copyTo(res(r), thresh);
更改为与零或1次匹配的量词,例如与?
匹配一次或多次的量词,或将星号+
匹配零的字符或多次,因为您要匹配多个值。