I have the following:
preg_match_all('/<\b([^<>]*)>/', $structure[1], $objects);

The structure is my document that is being searched, and the objects is the variable. The problem is, I don't want the code to find another result until the first tag name has been closed.

For example:
<game><i>Pacman</i></game>

The above code will find 'game' and 'i' as a result, even though the tag name <game> has not been closed yet (</game>). So in reality it should only find 'game' as a result, ignoring 'i' because 'game' has not been closed yet. Can someone show me the correct preg_match_all I need. Thank you so much.