diff --git a/src/ifcopenshell-python/ifcopenshell/util/selector.py b/src/ifcopenshell-python/ifcopenshell/util/selector.py index 020f5a3b50..ddd7220f17 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/selector.py +++ b/src/ifcopenshell-python/ifcopenshell/util/selector.py @@ -293,7 +293,10 @@ class Selector: results = [] for prop_name, prop_value in value.items(): if re.match(key, prop_name): - results.append(prop_value) + if isinstance(prop_value, (list, tuple)): + results.extend(prop_value) + else: + results.append(prop_value) value = results else: value = value.get(key, None) diff --git a/src/ifcopenshell-python/test/util/test_selector.py b/src/ifcopenshell-python/test/util/test_selector.py index e61eba3ea4..180a168815 100644 --- a/src/ifcopenshell-python/test/util/test_selector.py +++ b/src/ifcopenshell-python/test/util/test_selector.py @@ -88,6 +88,7 @@ class TestSelector(test.bootstrap.IFC4): ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Foo": "Bar"}) assert subject.Selector.parse(self.file, ".IfcElement[Foo_Bar.Foo]") == [element] assert subject.Selector.parse(self.file, ".IfcElement[Foo_Bar.Fox]") == [] + assert subject.Selector.parse(self.file, '.IfcElement[r"Foo.*ar"."Fo.*"]') == [element] def test_selecting_by_string_property(self): element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")