首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::match_results::length

difference_type length( size_type n = 0 ) const;

(since C++11)

返回指定子匹配的长度。

如果n == 0,则返回整个匹配表达式的长度。

如果n > 0 && n < size(),返回_n_th子匹配的长度。

如果n >= size(),则返回不匹配匹配的长度。

调用等效于(*this)[n].length()...

参数

n

-

integral number specifying which match to examine

返回值

指定匹配或子匹配的长度。

另见

operator[]

returns specified sub-match (public member function)

length

returns the length of the match (if any) (public member function of std::sub_match)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券