Q:

AS3 - Read all values from properties file that match certain key pattern

I've got a properties file with two distinct key-value pair patters like the following;

name.name.name.key = value
name.name.fullname.key = value

Accessing them one by one is fine if the key is known.
What I need now, though, is to access ALL values from say name.name.name without knowing the keys (integers to be exact). The values then have to be added to an ArrayList to be displayed in a List.
The keys are completely random, so I don't know the range beforehand (I can't and don't want to hardcode the range of range of keys for each single properties file), so simply looping through a previously defined range isn't what I need here. Also, the keys are not successive.
How can I do this with AS3?
Just for clarification as this seems to be a little confusing;
I do not want to parse the properties file. I rather want to solve this using the methods AS and Flex already provide.
The ResourceBundle class already has a method that outputs the content of the specified bundle. However, it contains all values. What I need is just a subset of values that match a given key pattern.
Edit:
To make this easier, I can drop the key pattern matching and create a new resource file with a distinct pattern. Now I only need to get all key-value pairs (I need both the integers from the keys and the value) from that resource.

A:

Here is a simple example with string parsing:
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;

var l:URLLoader = new URLLoader(new URLRequest("inp.txt"));
l.addEventListener(Event.COMPLETE, onComplete);

function onComplete(e:Event):void
{
    var data:String = e.target.data;
        //remove whitespace
    data = data.replace(' ','');
        //split data string by lines
    var pairs:Array = data.split("\r\n");
        //our name search pattern
    var pattern:RegExp = /name\.name\.name/;
        //array to store extracted values
    var values:Array = [];
    for each (var s:String in pairs) {
        if (pattern.test(s)) {
            //we've got a match, let's extract value
            var value:String = s.split("=")[1];
            values.push(value);
        }
    }
}

