# Find\_matching\_prim\_paths just with a part of the prim\_path

**URL:** <https://forums.developer.nvidia.com/t/find-matching-prim-paths-just-with-a-part-of-the-prim-path/273686>\
**Category:** Isaac Sim\
**Created:** [November 22, 2023, 9:46am UTC](https://forums.developer.nvidia.com/t/find-matching-prim-paths-just-with-a-part-of-the-prim-path/273686 "2023-11-22T09:46:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![quentin.deyna](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@quentin.deyna](https://forums.developer.nvidia.com/u/quentin.deyna)\
**Post date:** [November 22, 2023, 9:46am UTC](https://forums.developer.nvidia.com/t/find-matching-prim-paths-just-with-a-part-of-the-prim-path/273686/1 "2023-11-22T09:46:40Z")

</div>

Hi everyone,

I have some struggle with the function [find\_matching\_prim\_paths](https://docs.omniverse.nvidia.com/py/isaacsim/source/extensions/omni.isaac.core/docs/index.html#omni.isaac.core.utils.prims.find_matching_prim_paths)

I want to find the prim\_path of a prim which contain a specific expression like “`Geometry`” for example.

I first used the get\_parent, get\_children functions and try to find the string inside each prim\_path recursively and then I found the find\_matching function but for now I don’t find how to get it work.

To test it I first past “`/World/Geometry`” and it work well because it’s the exact expression but as the api doc mention, I understand that we can put a regex expression like "` .*Geometry.*`" but unfortunately it won’t work well…

Maybe I’m misunderstanding something in the doc or in it’s just not the right way to use it.

Is it something possible with this function or do I have to retry the get\_parent, get\_child workaround ?

Thanks a lot and have a good day !

---

<div class="post-metadata">

**Author:** ![toni.nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/toni.nv/32/294707_2.png) [@toni.nv](https://forums.developer.nvidia.com/u/toni.nv)\
**Post date:** [November 23, 2023, 9:02pm UTC](https://forums.developer.nvidia.com/t/find-matching-prim-paths-just-with-a-part-of-the-prim-path/273686/3 "2023-11-23T21:02:03Z")

</div>

Hi @quentin.deyna

Can you please use as an alternative the following snippet, while we investigate more about the implementation?

```python
import re
import omni.isaac.core.utils.stage as stage_utils
import omni.isaac.core.utils.prims as prims_utils

paths = [res.string for prim in stage_utils.traverse_stage() if (res:=re.search(".*Geometry.*", prims_utils.get_prim_path(prim)))]

print(paths)

```

---

<div class="post-metadata">

**Author:** ![quentin.deyna](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@quentin.deyna](https://forums.developer.nvidia.com/u/quentin.deyna)\
**Post date:** [November 24, 2023, 12:59pm UTC](https://forums.developer.nvidia.com/t/find-matching-prim-paths-just-with-a-part-of-the-prim-path/273686/4 "2023-11-24T12:59:34Z")

</div>

Hi @toni.nv

Thanks a lot for your help!

Your snippet works really well, it’s exactly what I want.  
I encounter an error :

> py stderr]: OSError: [Errno 90] Message too long

But it was that the prim it found was too long to be printed and by just accessing the first item with `print(paths[0])` it works perfectly.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [December 8, 2023, 1:00pm UTC](https://forums.developer.nvidia.com/t/find-matching-prim-paths-just-with-a-part-of-the-prim-path/273686/5 "2023-12-08T13:00:11Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
