Extracting IPs from Email Headers

I’m trying to extract IPs from email headers, from which I will run this array through a loop and check the reputation of each IP. However, the issue I’m having is when a header contains multiple IPs.

My workflow currently loops through each object in the headers array, and looks in the ‘value’ field, using the ExtractIt Plugin to find all IPs. These IPs are then converted to a string. I have created a custom output of an array from this loop, which contains all results that are not blank or broadcast addresses.

However, in the case where there are multiple IPs in one header, my custom output variable array will have a string with two IPs in it:

:: 2603:10a6:208:::",

How can I factor this into my loop, so that it recognises there are separate addresses, creates two separate array entries, and then append this onto my existing custom array instead of creating one array entry with two IPs separated by a blank space?

Edit: I have managed to get it working (very messily). I have to take the output of my loop which contains the three strings above, use TypeConvert to convert this into a single string, then TypeConvert back to an array (delimited by a whitespace so that it’s separated properly and I have 4 values in the array. However I would still like to hear of a more tidy/efficient way to do this!