How I tackle this is with BP:
I make a map -> String - Enum.
If the string corresponds in the map we get the enum as return.
In my project I have objects that can reside in an area. But also in multiple areas. So i make a string like house/garage/garden.
I split the string by ‘/’. Each return is checked in the map which gives me the corresponding enum. The ‘Right S’ is the new string to search for. If null, we exit otherwise we loop.