Question: i am trying to make a CLIish server in node.js.
but I need a way to parse a string and run a function from an object.
what I mean is... I don't want to nest a million switch statements just to have the commands I need.
using 2 other StackOverflow answers, I got 1 part done. inputs.

now i just need to figure out how to figure ou where the command stops and the input begins.
example:

inputting `do say user:Yimmee msg:"well hello" "something random":yes`
I need to separate `do say` and the inputs.
this is what i started with, but I do not know how to finish it.

```
function command(command, usable){
  //usable is the object holding the commands that can be used.
  //here I set commandMain to the part of command that is the command
  /*and where commandInput is too. and I'm not forcing you,
  but is preferably to be converted to an object.*/
  var commandSplit = [];
  do{
    var match = (/[^ "]+|"([^"]*)"/gim).exec(commandMain);
    if(match != null){
      commandSplit.push(match[1] ? match[1] : match[0]);
    }
  }while (match != null);
  var reach = `usable`;
  commandSplit.forEach((to, nu)=>{
    if(nu === commandSplit.length - 1){
      reach += `["_${to}"]`;
    }else{
      reach += `["${to}"]`;
    }
  });
  console.log(reach);
  try{
    return eval(reach)(commandInputs);
  }catch(error){
    return false;
  }
}

```

Note I gave up a little, there will be some ridiculous errors.

big fat edit::::::::::::::::::::::L:::::::
idk how in the world process.argv works, and looking in one of the answers, i know how to set it.
but i am using a live websocket for this.

Answer: 
You can use a generator expression.

```py
list1 = [1, 2, 3, 4, 5]
list2 = [1, 7, 9, 4, 5]

num_equal = sum(i == j for i, j in zip(list1, list2))
print(num_equal)  # 3

```

`zip(list1, list2)` returns an iterator containing tuples of each value in `list1` and `list2`, essentially forming pairs of corresponding items from the two lists:

```py
print(list(zip(list1, list2)))  # [(1, 1), (2, 7), (3, 9), (4, 4), (5, 5)]

```

You can then check if each pair is equal or not in a list comprehension, creating a list of `True` or `False`:

```py
print([i == j for i, j in zip(list1, list2)])  # [True, False, False, True, True]

```

You can take the `sum` of this list, as `True` casts to the integer `1` and `False` casts to the integer `0`. Note that we can use a generator expression instead of a list comprehension (leave out the `[]`) in the `sum` call to be more memory-efficient.
You can do a different approach. If both numbers equal then both are substrated the value will be zero. So, we can count the value of zero.

NB: This approach will only work for numbers.

```
In [13]: list(map(int.__sub__, list1, list2)).count(0)
Out[13]: 3

```