Swapped regular expression syntax used to Perl.

It's more widely used, and means that I should be able to perform regex
matching in Javascript too.
This commit is contained in:
WrinklyNinja
2013-09-18 13:08:34 +01:00
parent ea3876f78f
commit d9400ea57d
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ h3{
<ul>
<li>They are evaluated as paths relative to the game's Data folder.
<li>They cannot reference a path outside of the game's folder structure, ie. they cannot contain the substring <code>../../</code>.
<li>Regular expression file paths must be written in the <a href="http://www.boost.org/doc/libs/1_50_0/libs/regex/doc/html/boost_regex/syntax/basic_extended.html">POSIX Extended</a> syntax.
<li>Regular expression file paths must be written in the <a href="http://www.boost.org/doc/libs/1_54_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html">Perl</a> syntax.
<li>Only the filename of a regex file path may contain non-literal regex syntax, ie. if the filename part of the regex file path is removed, the remainder must be an exact folder path (though with the regex syntax special characters escaped). For example, given the regex file path <code>Meshes\\Resources(1|2)\\(upperclass)?table.nif</code>, BOSS will look for a file named <code>table.nif</code> or <code>upperclasstable.nif</code> in the <code>Meshes\Resources(1|2)</code> folder, rather than looking in the <code>Meshes\Resources1</code> and <code>Meshes\Resources2</code> folders.
</ul>
<p>Please test any changes you make before uploading them. One way of doing this is to run BOSS, another is to copy/paste what you've changed into an online parser such as <a href="https://yaml-online-parser.appspot.com/">this one</a>, though it won't catch condition syntax errors or non-syntax errors such as having the same file both required and incompatible.
+2 -2
View File
@@ -326,7 +326,7 @@ BOSS_API unsigned int boss_eval_lists (boss_db db, const unsigned int language)
if (it->IsRegexPlugin()) {
boost::regex regex;
try {
regex = boost::regex(it->Name(), boost::regex::extended|boost::regex::icase);
regex = boost::regex(it->Name(), boost::regex::perl|boost::regex::icase);
} catch (boost::regex_error& e) {
extMessageStr = e.what();
return boss_error_regex_eval_fail;
@@ -357,7 +357,7 @@ BOSS_API unsigned int boss_eval_lists (boss_db db, const unsigned int language)
if (it->IsRegexPlugin()) {
boost::regex regex;
try {
regex = boost::regex(it->Name(), boost::regex::extended|boost::regex::icase);
regex = boost::regex(it->Name(), boost::regex::perl|boost::regex::icase);
} catch (boost::regex_error& e) {
extMessageStr = e.what();
return boss_error_invalid_args;
+2 -2
View File
@@ -448,7 +448,7 @@ namespace boss {
BOOST_LOG_TRIVIAL(trace) << "Checking to see if any files matching the regex \"" << regexStr << "\" exist.";
boost::regex sepReg("/|(\\\\)", boost::regex::extended);
boost::regex sepReg("/|(\\\\)", boost::regex::perl);
std::vector<std::string> components;
boost::algorithm::split_regex(components, regexStr, sepReg);
@@ -478,7 +478,7 @@ namespace boss {
boost::regex regex;
try {
regex = boost::regex(filename, boost::regex::extended|boost::regex::icase);
regex = boost::regex(filename, boost::regex::perl|boost::regex::icase);
} catch (boost::regex_error& e) {
BOOST_LOG_TRIVIAL(error) << "The regex string \"" << filename << "\" is invalid.";
throw boss::error(boss::error::invalid_args, "The regex string \"" + filename + "\" is invalid.");