diff --git a/dep/boost/CMakeLists.txt b/dep/boost/CMakeLists.txt
index f9c98090d3f..988006b2ecd 100644
--- a/dep/boost/CMakeLists.txt
+++ b/dep/boost/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2017 TrinityCore
+# Copyright (C) 2008-2016 TrinityCore
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -26,28 +26,32 @@ if(WIN32)
set(Boost_USE_STATIC_RUNTIME OFF)
endif()
-find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams regex date_time chrono)
+include (CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+ #include
+ int main() { std::wregex r(L\".*\"); }"
+ STD_HAS_WORKING_WREGEX)
+
+if (STD_HAS_WORKING_WREGEX)
+ find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams)
+else()
+ find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams regex)
+endif()
# Find if Boost was compiled in C++03 mode because it requires -DBOOST_NO_CXX11_SCOPED_ENUMS
-include (CheckCXXSourceCompiles)
-
set(CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_IOSTREAMS_LIBRARY})
set(CMAKE_REQUIRED_FLAGS "-std=c++11")
-unset(boost_filesystem_copy_links_without_NO_SCOPED_ENUM CACHE)
check_cxx_source_compiles("
#include
#include
int main() { boost::filesystem::copy_file(boost::filesystem::path(), boost::filesystem::path()); }"
boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
-unset(CMAKE_REQUIRED_INCLUDES CACHE)
-unset(CMAKE_REQUIRED_LIBRARIES CACHE)
-unset(CMAKE_REQUIRED_FLAGS CACHE)
-
-if (NOT boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
- set(OPTIONAL_BOOST_NO_SCOPED_ENUMS -DBOOST_NO_CXX11_SCOPED_ENUMS)
-endif()
+unset(CMAKE_REQUIRED_INCLUDES)
+unset(CMAKE_REQUIRED_LIBRARIES)
+unset(CMAKE_REQUIRED_FLAGS)
add_library(boost INTERFACE)
@@ -63,5 +67,16 @@ target_compile_definitions(boost
INTERFACE
-DBOOST_DATE_TIME_NO_LIB
-DBOOST_REGEX_NO_LIB
- -DBOOST_CHRONO_NO_LIB
- ${OPTIONAL_BOOST_NO_SCOPED_ENUMS})
+ -DBOOST_CHRONO_NO_LIB)
+
+if (NOT boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
+ target_compile_definitions(boost
+ INTERFACE
+ -DBOOST_NO_CXX11_SCOPED_ENUMS)
+endif()
+
+if (NOT STD_HAS_WORKING_WREGEX)
+ target_compile_definitions(boost
+ INTERFACE
+ -DTC_HAS_BROKEN_WSTRING_REGEX)
+endif()
diff --git a/src/common/Utilities/Regex.h b/src/common/Utilities/Regex.h
new file mode 100644
index 00000000000..1d1ebca1b17
--- /dev/null
+++ b/src/common/Utilities/Regex.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2008-2017 TrinityCore
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see .
+ */
+
+#ifndef TrinityCore_Regex_h__
+#define TrinityCore_Regex_h__
+
+#ifndef TC_HAS_BROKEN_WSTRING_REGEX
+#include
+#define TC_REGEX_NAMESPACE std
+#else
+#include
+#define TC_REGEX_NAMESPACE boost
+#endif
+
+// regex compatibility layer, required for clang building with libstdc++-4.9
+namespace Trinity
+{
+ using regex = TC_REGEX_NAMESPACE :: regex;
+ using wregex = TC_REGEX_NAMESPACE :: wregex;
+
+ using :: TC_REGEX_NAMESPACE :: regex_match;
+ using :: TC_REGEX_NAMESPACE :: regex_search;
+}
+
+#endif // TrinityCore_Regex_h__
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index c5dc1046b8d..8c59ce0909f 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -25,8 +25,8 @@
#include "ItemTemplate.h"
#include "Timer.h"
#include "ObjectDefines.h"
+#include "Regex.h"
-#include
#include