Convert JSON string to Key / Value Arrays Convert JSON (key/value pairs) to two native arrays, one array of keys and another of values, in your language. 

var X = '{"a":"a","b":"b","c":"c","d":"d","e":"e","f":"f9","g":"g2","h":"h1"}';


The value array could be an array of strings or integers.

So we need two functions keys &amp; vals, returning native arrays on input of JSON string.

In above example the output would be:

keys : ["a", "b", "c", "d", "e", "f", "g", "h"]
vals : ["a", "b", "c", "d", "e", "f9", "g2", "h1"]


Here is my attempt at this using javascript:

keys : (53 Chars)

function keys(X){return X.match(/[a-z0-9]+(?=":)/gi)}


vals : (56 Chars)

function vals(X){return X.match(/[a-z0-9]+(?="[,}])/gi)}


Can other languages challenge this??
Python, 27/30

To actually comply with the rules:

keys=lambda x:list(eval(x))
vals=lambda x:eval(x).values()


Python, 30

Just using one function:

lambda x:zip(*eval(x).items())


This will separate the keys from the values and return them in a list.

Python, 7

If returning a dictionary is allowed, then this is all you need:

eval(x)