利用正则表达式判断字符串是否为数字(c++)

前端之家收集整理的这篇文章主要介绍了利用正则表达式判断字符串是否为数字(c++)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
#include<regex> using namespace std; bool is_number( string str_ ) { regex pattern( "^[\\d]+[\.]?[\\d+]?$"); return regex_match( str_,pattern ); } 原文链接:https://www.f2er.com/regex/362225.html

猜你在找的正则表达式相关文章