从tr1::regex_search中获取匹配索引
Get index of match from tr1::regex_search
使用std::tr1::regex_search
时如何获得匹配的索引?
// sequence of string sub-matches
std::tr1::smatch result;
if (!std::tr1::regex_search(text, result, pattern))
return false;
我只能从std::tr1::smatch result
变量中获得字符串,但不能获得匹配的索引。
我错过了它,因为我搜索了一个index
方法,但它就在那里作为一个方法- std::tr1::smatch::position()
将给出匹配的索引。
相关文章:
- C++17:如何在并行 STL 中获取工作项的索引
- Direct3D 11 - HLSL - 获取顶点索引 ID
- 在 std::variant 中按类型获取索引
- CPtrList - 如何获取元素的索引?
- 特征获取索引数组,其中向量中的值为真(不需要循环)
- 如何从折叠表达式中获取索引
- C++如何获取索引I处的元素,并检查它在向量或数组中是否为空
- 无法获取索引缓冲区以在 OpenGL 中绘制正方形
- 从索引缓冲区中获取索引
- 如何从QTreeView中的项目获取索引
- 从 C++ 数组元素的指针获取索引的最快方法是什么
- 算术在3D矢量中获取索引
- 获取索引信息的问题-SQL Server
- 从迭代器获取索引处的元素
- 在C++中,执行去引用和获取索引0的操作是相同的
- Q_PROPERTY WRITE获取索引
- 2d查找重复元素/获取索引位置并计数重复项
- 获取索引时qmodelindex的父参数
- Rgd:用于获取索引位置的矢量迭代器
- 获取索引和元素-向量问题