From 64bcdce60755dcc9c32865308a4c195e99ff3e0f Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 29 May 2022 10:21:42 +0200 Subject: [PATCH] Replace std::regex by std::string functions (fixes issue #3830) On Windows with UCRT and a UTF-8 locale std::regex takes a lot of time (several minutes!). Replacing it avoids that bottleneck. Signed-off-by: Stefan Weil --- src/ccmain/tessedit.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ccmain/tessedit.cpp b/src/ccmain/tessedit.cpp index ad929940..c97ce83c 100644 --- a/src/ccmain/tessedit.cpp +++ b/src/ccmain/tessedit.cpp @@ -23,8 +23,6 @@ # include "config_auto.h" #endif -#include // for std::regex_match - #include "control.h" #include "matchdefs.h" #include "pageres.h" @@ -248,12 +246,11 @@ void Tesseract::ParseLanguageString(const std::string &lang_str, std::vector