summaryrefslogtreecommitdiffstats
path: root/src/groupdef.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-02-13 19:34:13 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-02-20 19:17:51 (GMT)
commit7974279bd1da213244a527db16f0504355c1e074 (patch)
tree02365050579023b5b56edd8339678ec7e91004f4 /src/groupdef.cpp
parentbb25ca2abcce26688af658c088a6f4c73b030089 (diff)
downloadDoxygen-7974279bd1da213244a527db16f0504355c1e074.zip
Doxygen-7974279bd1da213244a527db16f0504355c1e074.tar.gz
Doxygen-7974279bd1da213244a527db16f0504355c1e074.tar.bz2
Refactoring: replace QRegExp by std::regex in groupdef.cpp
Diffstat (limited to 'src/groupdef.cpp')
-rw-r--r--src/groupdef.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index b900148..3fdb9fb 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -17,9 +17,9 @@
#include <algorithm>
#include <vector>
+#include <regex>
#include <ctype.h>
-#include <qregexp.h>
#include "groupdef.h"
#include "classdef.h"
@@ -1090,12 +1090,15 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(this,anchor(),FALSE);
- static QRegExp we("[a-zA-Z_][-a-zA-Z_0-9]*");
- int i=0,p=0,l=0;
- while ((i=we.match(m_title,p,&l))!=-1) // foreach word in the title
+ static std::regex we("[[:alpha:]_][[:alnum:]_\\-]*");
+ std::string title = m_title.str();
+ std::sregex_iterator it(title.begin(),title.end(),we);
+ std::sregex_iterator end;
+ for (; it!=end ; ++it)
{
- Doxygen::searchIndex->addWord(m_title.mid(i,l),TRUE);
- p=i+l;
+ const auto &match = *it;
+ std::string matchStr = match.str();
+ Doxygen::searchIndex->addWord(matchStr.c_str(),TRUE);
}
}