diff --git a/src/ifcparse/IfcUtil.cpp b/src/ifcparse/IfcUtil.cpp index efd0e8f64e..6721b35be2 100644 --- a/src/ifcparse/IfcUtil.cpp +++ b/src/ifcparse/IfcUtil.cpp @@ -149,10 +149,14 @@ bool IfcUtil::valid_binary_string(const std::string& s) { boost::regex IfcUtil::wildcard_string_to_regex(std::string str) { - std::string special_chars = "\\^.$|()[]*+"; + // Escape all non-"*?" regex special chars + std::string special_chars = "\\^.$|()[]+/"; foreach(char c, special_chars) { std::string char_str(1, c); boost::replace_all(str, char_str, "\\"+ char_str); } + // Convert "*?" to their regex equivalents + boost::replace_all(str, "?", "."); + boost::replace_all(str, "*", ".*"); return boost::regex(str); }