Edit
It seems I forgot to mention: this solution requires you to JSON encode the array: var workArr = JSON.stringify(theArr).replace(..). And once you're done: theArr = JSON.parse(workArr);
The quickest thing I could come up with is either do this:
var str = '[["1", "apple 1"], ["1", "pear 2"], ["2", "lemon 1"], ["12", "lemon 12"]]'.replace(/(\[")12/g,'$1twelve').replace(/(\[")2/g,'$1two').replace(/(\[")1/g,'$one');
But there are a couple of catches here: if write the replace(/(\[")12/g,'$1twelve') after you've replaced the ones, it won't work. so to get around this, you could do:
str = '[["1", "apple 1"], ["1", "pear 2"], ["2", "lemon 1"], ["12", "lemon 12"]]'.replace(/(\[")12"/g,'$1twelve"').replace(/(\[")2"/g,'$1two"').replace(/(\[")1"/g,'$one"');
Adding the closing quote. A more elegant solution, however is to create an object:
var replace = {'1':'one','2':'two','12':'twelve'};
And use the matched number as a property name.