How to add event to some asynchronous content after loaded

I would strongly suggest switching your intermediate format to something more strongly defined and easy to parse, such as JSON.

There’s a saying that goes something like this:

You have a problem, so you write a regular expression to solve it.
Now you have two problems.

Regex-based parsers are devilishly difficult to write. Just when you think you’ve covered all the edge cases, somebody comes along and drops the equivalent of “Little Bobby Tables” into incoming data (such as an unforseen delimiter character).

If you’re interested in pursuing this further, here is another post on this general topic that includes a JSON representation of these heterogeneous bone collections.