I am attempting to parse and search my json file using jQuery, I am able to parse the json file but not search it.

My HTML

`<ol id="results"></ol>`

My jQuery

```
$(document).ready(function() {
    $.getJSON('myJson.json', function(data) {
        $.each(data, function(i, item) {
            $('<li />').html(item.name + '<br>' + item.details + '<br>').appendTo('#results');
        }
    });
});​

```

The above code returns all items, however I now wish to allow users to search the json file, so i include a form input and create an onclick event and pass the input to a search see link below.

The problem is the input variable isnt being passed to the seach?
Please help.

<http://jsfiddle.net/xpTk5/7/>

---

UPDATE: Passing the variable to the Regex seems to be the problem.

---

Solved: `if (item.name.search(new RegExp(q, "i")) != -1){`

Thanks for your attempts and sorry for wasting your time.