[core] Regex refactoring

Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
x7z4w
2025-11-03 21:16:16 +00:00
parent a62f6c0ef6
commit 0a3a4ebd9a
17 changed files with 134 additions and 83 deletions

View File

@@ -17,10 +17,11 @@
#include <algorithm>
#include <cctype>
#include <memory>
#include <regex>
#include <sstream>
#include <unordered_set>
#include <boost/regex.hpp>
#include "defines.hpp"
namespace platform
@@ -42,8 +43,8 @@ bool IsSpecialName(string const & name) { return name == "." || name == ".."; }
*/
bool IsDownloaderFile(string const & name)
{
static std::regex const filter(".*\\.(downloading|resume|ready)[0-9]?$");
return std::regex_match(name.begin(), name.end(), filter);
static boost::regex const filter(".*\\.(downloading|resume|ready)[0-9]?$");
return boost::regex_match(name.begin(), name.end(), filter);
}
bool IsDiffFile(string const & name)