1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

May only include alphanumeric characters and underscores and may not start with a number.

This commit is contained in:
Marek Kochanowicz 2014-02-16 20:18:28 +01:00
parent 3cc23a9cb3
commit b83817e05e

View file

@ -83,6 +83,6 @@ bool CSVWorld::ScriptEdit::stringNeedsQuote (const std::string& id)
{ {
QString string(QString::fromStdString(id)); //<regex> is only for c++11, so let's use qregexp for now. QString string(QString::fromStdString(id)); //<regex> is only for c++11, so let's use qregexp for now.
//I'm not quite sure when do we need to put quotes. To be safe we will use quotes for anything other than… //I'm not quite sure when do we need to put quotes. To be safe we will use quotes for anything other than…
QRegExp regexp("^[a-z]{1}[a-z|0-9]{0,}$", Qt::CaseInsensitive); QRegExp regexp("^[a-z]{1}[a-z|0-9|_]{0,}$", Qt::CaseInsensitive);
return !(string.contains(regexp)); return !(string.contains(regexp));
} }