正则表达式判断是否是数字

Danlis / 2024-10-05 / 原文

`c++

include

bool isNum(string str){
regex num_check("[1]+$");
return regex_match(str, num_check);
}
`


  1. 0-9 ↩︎