summaryrefslogtreecommitdiff
path: root/src/nexusinterface.cpp
diff options
context:
space:
mode:
authorThomas Tanner <trtanner@btinternet.com>2015-12-05 10:21:44 +0000
committerThomas Tanner <trtanner@btinternet.com>2015-12-05 10:21:44 +0000
commitec9c78f8fa49ce960fb708d4a140c44ed3130989 (patch)
treec6601b7045432caa5295b5cd1a4b51c6f19f5cb1 /src/nexusinterface.cpp
parent7f9af7f93e1d06d021fd60bf4845d928f4a6bc38 (diff)
parent688e149c96c29d8249c9db416f5773cfc7baad6d (diff)
Merge remote-tracking branch 'TanninOne/master'
# Conflicts: # SConstruct # src/modinfo.cpp # src/modinfo.h
Diffstat (limited to 'src/nexusinterface.cpp')
-rw-r--r--src/nexusinterface.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nexusinterface.cpp b/src/nexusinterface.cpp
index b4775e2d..ec76b8fe 100644
--- a/src/nexusinterface.cpp
+++ b/src/nexusinterface.cpp
@@ -196,12 +196,13 @@ void NexusInterface::loginCompleted()
void NexusInterface::interpretNexusFileName(const QString &fileName, QString &modName, int &modID, bool query)
{
- static std::tr1::regex exp("^([a-zA-Z0-9_\\- ]*?)([-_ ][VvRr]?[0-9_]+)?-([1-9][0-9]+).*");
- static std::tr1::regex simpleexp("^([a-zA-Z0-9_]+)");
+ //Look for something along the lines of modulename-Vn-m + any old rubbish.
+ static std::regex exp("^([a-zA-Z0-9_'\"\\- ]*?)([-_ ][VvRr]?[0-9_]+)?-([1-9][0-9]+).*");
+ static std::regex simpleexp("^([a-zA-Z0-9_]+)");
QByteArray fileNameUTF8 = fileName.toUtf8();
- std::tr1::cmatch result;
- if (std::tr1::regex_search(fileNameUTF8.constData(), result, exp)) {
+ std::cmatch result;
+ if (std::regex_search(fileNameUTF8.constData(), result, exp)) {
modName = QString::fromUtf8(result[1].str().c_str());
modName = modName.replace('_', ' ').trimmed();
@@ -231,7 +232,7 @@ void NexusInterface::interpretNexusFileName(const QString &fileName, QString &mo
modID = strtol(candidate.c_str(), nullptr, 10);
}
qDebug("mod id guessed: %s -> %d", qPrintable(fileName), modID);
- } else if (std::tr1::regex_search(fileNameUTF8.constData(), result, simpleexp)) {
+ } else if (std::regex_search(fileNameUTF8.constData(), result, simpleexp)) {
qDebug("simple expression matched, using name only");
modName = QString::fromUtf8(result[1].str().c_str());
modName = modName.replace('_', ' ').trimmed();