Q:

Node js Separate String into arrays

Got a String which look like this
-FirstName (Some Random Name) -LastName (Some Random Last Name) -Age 30

I'm looking for the best and easiest way to extract the First name Last name and Age from this string.  So i can store this Data in a Database. 
The order of the tags can be random. 

A:

UPDATED ANSWER
As I remember indexOf is faster the regular expressions.  So this is the answer for your question:
var a, i, flags, result, flag, entry, start, end;

a = "-FirstName Some Random Name -LastName Some Random Last Name -Age 30"

flags = ["-FirstName", "-LastName", "-Age"];
result = [];
for (i = 0; i < flags.length; i++) {
    flag = flags[i];
    entry = a.search(flag);
    lookup_start = entry + flag.length;

    end = a.indexOf("-", lookup_start);
    end = (end == -1) ?  a.length : end;
    result.push(a.slice(lookup_start, end).trim())
}

console.log(a);
console.log(result);

Now you will have a mapping - flags[i] -> result[i].  So you can build up an object for example easily.